(I hit Send by mistake - sorry for the premature mailing....)
Paul,
I'm afraid I'm pressed for time at the moment, but I'd like to share our
approach. I can't say with certainty that this was the best approach (we've
discussed it on the list before in fact) but it is getting the job done for
us. (Criticisms welcome :)
We have multiple "objects" upon which we perform maintenance. Each object
has a "search" screen and a "detail" screen. Our Action needs to do
different things when a different button is pressed (basic CRUD functions,
few advanced things, etc). Each object, while different, shares a great deal
of generic code in order to prepare data and pass it along to some EJB
(session bean). Thus, we have an abstract "Action" class that contains all
our generic code. Then, in our object-specific action implementations (they
extend the abstract class and then also contain the perform method) we make
calls to the various generic methods defined in the abstract class.
Depending on the situation, we will pass in a (EJB) home reference to a
method and that method will then make the appropriate method calls to the
session bean. To get data back and forth, we have a second method on the
object-specific actions (because the data is different for different
objects) wherein we set values on a "data object" that the bean uses for
running queries, etc.
Basically sample syntax is: data.setSomeId(form.getSomeId());
We simply call this method when calling the session bean's method that
requires the data, and then pass the data object in. It's certainly not the
best way to do this -- there are more efficient ways to populate the data
object but we hit certain limitations process-wise and time-wise and this is
where we are. All short-comins aside, it does get the job done. :)
BTW -- The mapper framework looks extremely promising and I'm interested to
try it out shortly, just wish time would provide itself. :P
Chris