This is what I'm during in current development, I just need to put together a generic standard Action, like the ProcessAction from Scaffold (only simpler).
One very useful strategy is to name the ActionForm attribute after the corresponding Command. The ActionForm attribute is also the ValdationForm key, which speaks to what input parameters the Command expects. The ducks all line up in a row.
----
name="app.MyActionForm" attribute="add_account"
...
form name="add_account" ...
...
command name="add_account" ...
---
The Command is then invoked automagically by using the form attribute name as the command key.
For lack of a better name, I've been calling this the "symbolic strand" pattern. You give the use-case a symbolic name, and then keep using the name between layers, forming a contextual strand through the application. To close the loop, I would have a SQL query called by the Command also named "add_account".
IMHO, whatever the Action does should either be put into a base class, or into a catalog of business commands that can be used (and tested) separately from the Struts portion of the application.
Though, I do mean to try giving the Action it's own customizable RequestProcess gauntlet, rather than a base class, but that implementation could use the same techniques we're using now.
-Ted.
Peter A. Pilgrim wrote:
Ted Husted wrote:
It might be better to bring this up on Commons Chain, Peter, since these questions seem to transcend our implementation of the Request Processor (aka "Struts Chain").
-Ted.
Peter A. Pilgrim wrote:
I am investigating the possibility of commands that can branch dynamically.
Why was the ChainBase frozen in the execute() method? What is the design decision or intention of NonDelegatingCommand.java?
What do you need to successfully compile and build the chain module?
Well I guess what I am really after is a successful action chaining features that works with Commons Chain.
I see there are couple of abstract classes:
contrib/struts-chain/src/java/org/apache/struts/chain/AbstractSelectAction.java
contrib/struts-chain/src/java/org/apache/struts/chain/AbstractExecuteAction.java
To perform the action chain means add two these into a new Chain or creating
a new Catalog with these Chains.
This is why I wanted to know is Action going to be more a Command, or is it going to stay a seperate entity as it is now the Controller in MVC Model 2.
-- Ted Husted, Junit in Action - <http://www.manning.com/massol/>, Struts in Action - <http://husted.com/struts/book.html>, JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]