I would, yes. 

I use one Action class for all four CRUD operations on a table (or
logical view), along with any special retrievals. 

I may use separate helper classes for specialized operations, but I try
to reduce the number of individual Action classes, since these are
instantiated for the life of an application. 

The overall pattern is that the Action selects a Helper, and passes
information about the request (e.g. the parameters). The Helper calls
the appropriate Data Access object (plain Java class), which returns a
RowSet for retrievals, or just a count for other operations. The Helper
wraps the RowSet (aka Value Object), and is inserted into the request by
the Action. The Action also transfers data between the RowSet and
ActionForm as needed for inserts, selects, or updates.

Only the Action is linked to any HTTP packagaes. The Helper and Data
Access objects could be used in any environment.

Matt Raible wrote:
> 
> Would you recommend using one subclassed Action servlet for both an EditAction
> and SaveAction?  I based my design off the example application - and have two
> separate classes.
> 
> Thanks,
> 
> Matt

Reply via email to