You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Peter A. Pilgrim" <pe...@xenonsoft.demon.co.uk> on 2003/11/16 02:27:02 UTC

[struts chain] Investigating Dynamic / Proxy Commands?

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?

-- 
Peter Pilgrim
            __ _____ _____ _____
           / //__  // ___// ___/   +  Serverside Java
          / /___/ // /__ / /__     +  Struts
         / // ___// ___// ___/     +  Expresso Committer
      __/ // /__ / /__ / /__       +  Independent Contractor
     /___//____//____//____/       +  Intrinsic Motivation
On Line Resume
    ||
    \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''


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


Re: [struts chain] Investigating Dynamic / Proxy Commands?

Posted by Ted Husted <hu...@apache.org>.
Personally, I would setup my own catalog for the application that 
contained all the business commands. The Action then prepares the 
context, invokes the Command from the Catalog, and extracts the result.

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: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: [struts chain] Investigating Dynamic / Proxy Commands?

Posted by "Peter A. Pilgrim" <pe...@xenonsoft.demon.co.uk>.
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.

-- 
Peter Pilgrim
            __ _____ _____ _____
           / //__  // ___// ___/   +  Serverside Java
          / /___/ // /__ / /__     +  Struts
         / // ___// ___// ___/     +  Expresso Committer
      __/ // /__ / /__ / /__       +  Independent Contractor
     /___//____//____//____/       +  Intrinsic Motivation
On Line Resume
    ||
    \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''


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


Re: [struts chain] Investigating Dynamic / Proxy Commands?

Posted by Ted Husted <hu...@apache.org>.
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?
> 

-- 
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: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org