Dakota Jack wrote the following on 1/27/2005 12:24 AM:

For me, and of course I speak for myself alone, I could not stand the
view being so tightly bound as your suggestion.  Maybe I misunderstand
what you are doing.

The reason I like the approach I favor is that you can write the
Struts code in the Action, etc., and the code on the JSP pages without
knowing a thing about what is happening behind the scenes.  You really
don't even need collaboration.  You can even write simply tools to
build test classes by code generation for whatever is on the JSP pages
without much difficulty.

I'd be interested more in how you would handle this. I do not like the view 'tightly' bound with Actions either, but reality often kicks in and sometimes I don't see a convenient way to handle things. So, I'll throw the question then back to you concerning how you would handle the problem at hand...


To make it simple imagine you want a title to display that is based in a reusable layout page that can have some dynamic information based on 'what was done' in your business method. For example you want a title to display:

"Updating user John Doe of Acme Company"

Explain to me where you would set "John Doe" and set "Acme Company" so that the title section of a tile would have access to those values? I do not see how you can abstract that out very much. You might be able to put another layer (possibly a post filter) where you can code some logic that determines where you are going and what it needs to get out and set up for the view. I thought of this approach and I find it ends up doing yet another problem I see in so many web apps - over complication. We think we are simplifying things and making things more clean yet when in actuality it just makes things more confusing - especially to a new person that comes on board. So I'd be interested in your approach to the real world problem above.

I often use the same approach when setting up some custom success messages. For example your view layer might not have access to a User object yet your action when you saved does, but you might want display a success message such as

"John Doe of 1245 North Street was successfully updated"

Of course remember I'm not putting the exact syntax of the message into scope from the Action - I'm just adding the relevant params the MessageResources needs ie:

messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.update.success", userName, companyName));

saveMessages(request, messages);

I'm probably just being dense but I don't see what the following, you mention, would help with:

 "Also, I like to have this state object wrapped such that there is an
interface not unlike getState(...) for either the Action or the model.
 Whatever is in between the interface and the map is purely
implementation and subject to whatever choices, improvements, etc. one
might make."

I'd really appreciate more feedback with a practical example, using the situation provided above. Thanks a lot.

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to