Joe Germuska wrote:

At 10:48 PM -0400 6/21/04, Joe Hertz wrote:

Okay, whew. Knew I had seen something else about it.

http://www.jguru.com/faq/view.jsp?EID=1057613

"...There are times when one Action should forward to another, but only
to display the final result. Using a second action to complete a
business transaction is where we start sliding toward the dark side.".

So, I figured getting the data to display was safe. Caring about the
request data however seems to be where one draws the line, which this
question clearly did.

Am I wrong (again)?


Well, I would say that if you understand why request chaining is "dangerous" and can make a knowledgeable judgment in a specific case that the dangers don't apply, then go ahead and do it.

Longer term, I would like to see a specific pre-view step in the request processing cycle which does preparation for the destination forward. We've had discussions on the dev list about this (including subject lines with the term "PageController" or "ViewController") and people seem generally interested. I've made this pattern work at my day job and find it clean and flexible -- but the way we do it at work is tangled up with other details of our implementation that are more specific to how we do things and probably not the kind of thing we want to foist on all Struts users.

Joe


I notice that as soon as someone is talking about forwarding to another Action all these flags go up and "Chain of Responsibility" gets said. This is an excellent point where what we are talking about is not that we are interested in doing CoR. There's a razors edge it appears. On one hand its recommended that to apply MVC properly, all requests should go through the Action and be forwarded to a JSP, but if said Action "initializes" important values which the JSP needs to generate the presentation. Then forwarding has to be to the Action, and thus chaining occurs. But is the Goal really CoR? No, the goal is that I want to intialize values in my view from my model.

One possible solution that fits within the strategy would be to implement a more restrictive DispatchAction with a method specifically for "initialization" and a method specifically for "execution", create to different Actions, one for intialization and one for execution. forwarding to "IntializationActions" from "ExecutionActions" is allowed, but forwarding to "ExecutionActions" from "InitializationActions" or other "ExecutionActions" is not.

what do you think?
Mark

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

Reply via email to