It's not a bad approach. 

Instead of using a switch statement, or equivalent, Artimus specifies
which business logic bean to use as a parameter to the ActionMapping. 

The HelperAction instantiates that bean, populates it, and tells it to
do whatever it was made to do.

This reduces the number of Actions that need to be maintained, and gets
everything into the struts-config. 

It also assures that the logic is not tightly coupled to an Action
(since there are so few). 

But looking at the request parameters to select a bean, or method on the
bean, will get the job done too.

The important thing is to be sure to use the JDBC beans, and not embed
business logic into the Action.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/


[EMAIL PROTECTED] wrote:
> 
> <struts-newbie>
> 
> I used David Winterfeldt's Generator against a table called "broker" to
> produce a form bean, a broker bean, a broker_PK (primary key) bean, and a
> brokerjdbc bean (which contains SQL CRUD functions).
> 
> Now I need to create the Action (or Actions) to handle these operations. I
> have looked at Ted Husted's Artimus app where he uses Helper Objects and
> creates one Action with multiple "perform" methods. I think I understand
> what's going on, but isn't there a simpler way?
> 
> Is there anything wrong with just checking the request parameters within the
> Action to see which button was clicked and then call the appropriate method
> on the jdbc bean? Or is that a bad approach?
> 
> </struts-newbie>

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

Reply via email to