struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: struts-faces
Date Thu, 18 Sep 2003 10:57:24 GMT
Likewise, if anyone really wanted throwaway, non-threadsafe Actions, 
there's a nice technique that Maverick uses. A regular singleton Action 
is used as a wrapper. When execute is called, the wrapper instantiates a 
new instance of the desired type and returns the outcome of its execute. 
  But the ActionForm technique Greg describes would be an even better 
way to create throwaway Actions.

Gregory Seidman wrote:
> On Wed, Sep 17, 2003 at 01:14:27PM +0200, Adam Hardy wrote:
> } I remember a while ago in one of these architecture- theme emails you 
> } discussed the OO nature of struts & it had been said that the 
> } action-form class and the action class broke the OO encapsulation 
> } principle, by having data in one and functionality in another. You said 
> } if you were going to design struts again, you would probably address this.
> [...]
> 
> This is a quibble. If you want to put your functionality into your
> ActionForm class, go ahead. Create an abstract ActionForm subclass that has
> a takeAction() pure virtual method in it (with appropriate arguments).
> Create an Action class which does nothing more than cast to your ActionForm
> subclass and call takeAction(). There you go, functionality in the same
> class that holds the data.
> 
> } Adam
> --Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

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


Mime
View raw message