Jeromy Evans wrote: *You're correct. ModelDriven does not give you much benefit other than to put a single Model object, rather than the Action, at the top of the ValueStack (the Action falls to second). In many respects, that's a limitation rather than a benefit.*
It depends how the architecture of your app is designed. If you can try to read "Pojo in Action" it's great book, and i'm not selling it :P, but basically the author talks about two commons aproach: 1 using a facade to separete presentation tier from buissines tier and 2. the use of "exposed domain" aproach. If your application use "exposed domain" aproach you can get a lot of benefits and less boring code using the ModelDriven interface. I have made a pair of S2 application and ModelDriven interface has been really useful for me. On Tue, Mar 4, 2008 at 8:35 PM, Jeromy Evans < [EMAIL PROTECTED]> wrote: > Gabriel Belingueres wrote: > > I thought that a possible explanation would be to keep the view (JSP) > > pages unaware of the scope of the variables it uses but honesty I'm > > not fully convinced of the gain I can achieve with this practice. > > > > I've developed a conversation scope interceptor I'm using in my > > projects and I don't use modelDriven interface. > > > > ModelDriven interface is (IMHO) uncomfortable because it is designed > > to return only one object for use in the view, which IMO is > > unrealistic but in the simplest use cases. In addition, if you want to > > use several objects in the view, it forces to either create a DTO (not > > good) to reunite all data or using a Map with domain objects but in > > either case you end up with something not very different to not using > > model-driven. > > > > Hi Gabriel, > > You're correct. ModelDriven does not give you much benefit other than > to put a single Model object, rather than the Action, at the top of the > ValueStack (the Action falls to second). In many respects, that's a > limitation rather than a benefit. > > It's an alternative approach that suits some circumstances. Some people > like the strict distinction between the action and the object being > acted upon. > > Personally, I don't favour ModelDriven on normal actions that are used > to populate a view. Like you stated earlier in the thread, I prefer > using %{contact.firstName} rather than %{firstName} and often have > multiple beans that need to be accessed. However, I have found it > useful with the REST plugin as I typical deal with a single resource > type (the Model) and take care that it can be serialized into XML or > JSON as well as populate a view. Again that's mainly about demarcation > between the action and model and of no significant technical merit. > > regards, > Jeromy Evans > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >