struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <new...@pingsite.com>
Subject Re: Is Action Chaining Strongly Discouraged?
Date Wed, 03 May 2006 18:17:10 GMT
Tarek Nabil wrote:
> Do you mean that you're doing a redirect after processing the post?
>   

Who, me? If no, ignore the following.

I'm not sure I understand the question. In a nutshell: for a GET I do
whatever population/misc. stuff I need to do then return the input
forward. For a POST I validate and return the input forward if there are
errors, otherwise I return whatever forward is warranted.

In practice by classes have become more cumbersome than that with
methods designed to be overridden that do pre- and post-processing etc.

> I've been thinking about this action chaining issue for some time since
> I used it in my last project and it resulted in some code duplication.
>   

Isn't that bass-ackwards? Even though I really dislike chaining
shouldn't it have less code?

> 1- A prepare action when the page is called directly (a form bean is
> configured for that one).
> 2- A page action when it's called from another action (no form bean is
> configured to prevent resetting).
>   

*shudder*

If no other reason here's a strong reason to move that logic out of the
actions and into service objects; at least then you're just making calls
rather than duplicating the code. Unless I completely misunderstood you.

> Would anyone care to comment on those two approaches? Does anyone have a
> different approach that I can consider?
>   

At first glance with no clue what you're trying to accomplish it sounds
overly complicated.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message