Put me down for the Util class approach.  We make a habit out of doing the
heavy lifting in a logic layer which is accessed via static calls or a
Singleton instance depending on the need.  I don't like to see 2000 line
Action classes full of business logic because it doesn't let us move that
logic around without making tidal waves in the app.  If we ever want to
implement something in a filter or some other layer that doesn't exist yet,
we simply need to call out to the util classes that are already coded &
tested.

-Breddy

> -----Original Message-----
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 30, 2003 10:41 PM
> To: Struts Users Mailing List
> Subject: RE: one desing question, need help
> 
> 
> Shared utility class is probably your best bet.
> 
> In my app, I actually created my own dispatch action class 
> that extended my
> base Action class (by cutting and pasting the struts dispatch 
> action source
> into my own class changing the 'extends'declaration), though this has
> various drawbacks, the most notable of which being that you 
> would need to
> update the code in this class if you changed the version of 
> struts you were
> using. Id recommend you go with the static utility class, 
> though as other
> posters mentioned, certain things are better suited to 
> filters, so you do
> have a couple of options to look at.
> 
> -----Original Message-----
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 31 January 2003 07:30
> To: [EMAIL PROTECTED]
> Subject: one desing question, need help
> 
> 
> Hi,
> 
> I want to write 2 classes , one class say MyAction
> extends Action and the other class say
> MyDispatchAction extends DispatchAction.
> I want to have some code ( like setting some
> parameters or getting connection from pool) handled in
> both the classes, but i want to write it in such a way
> that i dont have to code all the common methods in
> both classes.
> I dont want to have one class which extends
> DispatchAction, because DispatchAction needs parameter
> as required field in struts-config file.
> 
> This way i would be reducing my coding  and future
> maintenance, since if there is any modification i can
> do it at only one place and will be applicable to both
> places
> 
> Any suggestions are welcome
> 
> 
> 
> 
> 
> 
> 
> =====
> A$HI$H
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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

Reply via email to