Having reusable action classes that can be strung together through struts-config is pretty useful in that you don't have to have as much coding. You can then have a work pipeline of sorts without having to create extra action classes or modify more code.
BAL
From: Ted Husted <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: design question about action chainning(As quoted in :Struts in action...by Ted Husted et al..)
Date: Fri, 31 Jan 2003 13:06:30 -0500
The best example of waht I'm calling an Action relay is how Struts handles validation. If validation fails, the request is forwarded to the input property, which could be another Action. This is done to complete the response, rather than continue with processing the action.
This same technique is often used after a lookup, where one Action does the lookup but another Action is used to complete the response, usually to setup any tools the page might need to render.
In an Action chain, control is not forwarded simply to complete the response but to continue processing. One action doesn't "do" some similar activity because that's the another actions "job". The request/response transaction begins to be distributed between several Action, and this is where Action stop being destinations and start becoming an API.
Most often, whatever processing the Action in a chain are supposed to be doing can be refactored into base actions or utility classes, so the funcationality can be reused using standard object-orientated techniques.
-Ted.
--
Ted Husted,
Struts in Action <http://husted.com/struts/book.html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]