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]

Reply via email to