I thought of something similar too Jim, but my thought was that now they are 
coding classes that don't truly adere to the general form of an Action.  I 
would rather have the basic structure remain the same and just make them have 
to remember to call the setup code.

Think of it this way... the more a team veers from "standard" Struts (or 
standard anything for that matter!), the more a new team member has to learn 
and comprehend before they can really be effective.  In my mind, a single 
method call that someone has to remember is better with the idea of swappable 
human resources in mind than having to learn and understand a new structure for 
an Action (even if it is very simple, as what you show is).

I suppose we could have the best of both worlds if you implement a custom 
RequestProcessor that looks for some flag attribute in request that is only set 
from the setup code and redirects to some error page if it's not set.  That 
way, the Actions can remain structured as usual, and if a developer forgets 
that setup call, they'll know about it right away.

But then, that starts to feel like babysitting my developers, and I for one 
don't do that.  I hire those that I have confidence in, and I let them do their 
thing based on my architectural blueprints.  I trust them to get it right, or 
at least quickly and efficiently fix it if they don't! :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, January 24, 2005 1:15 pm, Jim Barrows said:
> On Mon, 24 Jan 2005 10:05:08 -0800 (PST), [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>>
>> On Mon, January 24, 2005 12:37 pm, Gianpiero Caretti said:
>> > FYI, that's exactly what I am doing rigth now!
>>
>> Great minds think alike :)
>>
>> > The only think I don't like with this solution is that the JSP writer
>> has
>> > to
>> > know the existence of the "command" attribute into request. Moreover
>> if
>> > the
>> > Action writer forgot to call the "setup" method the request attribute
>> will
>> > not
>> > set.
>>
>> True enough, but at some point you have to trust those under you.  So
>> long as you make this information known, you have to trust that they
>> will use it.
> 
> If they remember, don't get in a hurry or otherwise do something human.
> Why not do something like
> private static blah execute(blah) throws Exception {
>     criticalSetupstuff;
>     continueExecute(blah);
> }
> protected blah continueExecute(bladh) throws Exception {
>   whatever the execute should do.
> }
> 
> That way you can gurantee that anyone inheriting from this action will
> get the crttical setup stuff.
> 
>>
>> --
>> Frank W. Zammetti
>> Founder and Chief Software Architect
>> Omnytex Technologies
>> http://www.omnytex.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