At 5:10 PM -0700 4/30/06, David Evans wrote:
below...

On Sun, 2006-04-30 at 17:47 -0500, Joe Germuska wrote:
 On 4/30/06, Caroline Jen <[EMAIL PROTECTED]> wrote:
 >I have seen some discussions on this forum regarding
 >action chaining.  Primarily, the advices are to think
 >through the business logic before making decision on
 >chaining actions.
 >
 >What are the disadvantages of action chaining?  Why
 >action chaining is not a good practice?

 http://wiki.apache.org/struts/ActionChaining

 As noted in that page, ActionChaining is using Struts in a way which
 often works, but for which it was not specifically designed.  It's
 possible that you might run into some odd situations where the
 assumption that a single HttpRequest results in only a single pass
 through the RequestProcessor causes something to go wrong.

 I usually just refactor my app when I find myself wanting to use
 action chaining, but many people just do it and find that it works.

 Joe

How do you handle the population of the contexts which are passed to the
jsp to which you are forwarding?
...
Is there a reason you don't use the two action (setup and submit)
approach?

The reason I don't is because I know that the original design of the RequestProcessor didn't expect there to be two passes through in a single request, so that it's possible (in theory) for some values to be in unexpected state. Having known that, i've just developed design strategies which don't require chaining.

We use Tiles in every webapp we do, so I have often used Tiles Controller classes for view population; I've also designed a few strategies implemented with changes to the RequestProcessor (or with custom chain commands since struts-chain) -- but none of which I felt were clearly something which should be committed to Struts proper.

I know for a fact that many people have used action chaining (and I have at times too) and it hasn't been a problem. I can't cite specific problems people have raised in the past that traced back to action chaining, but maybe there's something in the archives.

So it's not so much that ActionChaining is considered "harmful" as it's understood to be potentially surprising.

Hope that helps
        Joe


I'm in the process of learning webwork and while i'm at it i'm trying to
decide on best practices for action architecture. Webwork makes the two
action thing even easier, because you can specify a method to call on an
action class in the action mapping, so the setup and submit handling
methods can exist in the same action class. or you can even specify the
method to call on an action class in the url using the ! character, as
in /customer!setup.action.

You can achieve most of this with dispatch actions.
--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com
"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
        -- Robert Moog

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

Reply via email to