Just for a different perspective...

If we took that approach we could conceivably have hundreds of actions that looked 
almost identical except for the value of a few variables.  So, we're building a model 
layer that creates and invokes components in a standardized way.  So, (when it's all 
built) we will write hundreds of components with "little nuggets" of business logic to 
a standard interface and we'll have a couple of generic actions that perform commands 
on those components based on parameters in the request or settings in ActionMappings.

If there are special cases where the controller logic for a component is just too 
complex, we'll write more actions.  Or, if another application would use the 
components differently, they can create more actions.  But for our application, this 
approach greatly increases productivity and eases maintenance b/c there is less code 
to write.

Now, the drawback is that it looks a lot like EJB, except that the "container" is a 
single broker or factory class.  But the advantage is that our developers can focus 
their attention on the business logic, focusing less attention on who called me or 
where do I go next.

Greg

> -----Original Message-----
> From: David Graham [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 11, 2002 2:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Struts design: All actions in one ActionClass
> 
> 
> I apply this theory to jsps as well. Each JSP displays one 
> thing; otherwise, 
> you'll end up with something resembling a perl script with a 
> bunch of if 
> statements.  This allows you to reuse the jsp in other places 
> that need that 
> same view (or tile).
> 
> David
> 
> 
> 
> 
> 
> 
> >From: "Jordan Thomas" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: RE: Struts design: All actions in one ActionClass
> >Date: Wed, 11 Dec 2002 20:43:51 +0100
> >
> >Does this also count for the JSP's? It would seem that it 
> would be better 
> >to
> >reuse the JSp's where possible which seems possible.
> >
> >-----Original Message-----
> >From: David Graham [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, 11 December 2002 7:27 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Struts design: All actions in one ActionClass
> >
> >
> >Definitely b.  It will be far easier to maintain.  If you're 
> worried about
> >having a lot of actions you can look at DispatchAction or 
> using DynaBeans.
> >
> >David
> >
> >
> >
> >
> >
> >
> > >From: "Jordan Thomas" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> > >To: "Struts-User" <[EMAIL PROTECTED]>
> > >Subject: Struts design: All actions in one ActionClass
> > >Date: Wed, 11 Dec 2002 19:05:36 +0100
> > >
> > >Hi,
> > >
> > >What is the best way to design my application? Is it better to
> > >
> > >a) Put all my actions for a particluar area (i.e. 
> creating, editing and
> > >deleting user accounts) in one Action class
> > >
> > >or
> > >
> > >b) Use a seperate action class for every action in my application
> > >
> > >or
> > >
> > >c) Put all of the actions for a particular workflow in a 
> single Action
> > >class.
> > >
> > >I am looking to have an application that is easy to maintain and 
> >flexible.
> > >Suggestions/Advice would be most appreciated.
> > >
> > >thanks
> > >
> > >Jordan
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:
> > ><mailto:[EMAIL PROTECTED]>
> > >For additional commands, e-mail:
> > ><mailto:[EMAIL PROTECTED]>
> >
> >
> >_________________________________________________________________
> >Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> >http://join.msn.com/?page=features/featuredemail
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
> >
> >--
> >To unsubscribe, e-mail:   
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail: 
> ><mailto:[EMAIL PROTECTED]>
> 
> 
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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

Reply via email to