Memo from Nic Hobbs of PricewaterhouseCoopers
-------------------- Start of message text --------------------
Donnie,
Can't you just subclass the struts Action class add the necessary common
functionality and then subclass this new class for each of your actions?
Then there is no multiple inheritance problem and the common functionality is
there for you to use. That still doesn't get around the conceptual grouping of
similar actions together but I agree with others that they are possibily better
as separate files...
Just an idea.
HTH
Nic
DONNIE HALE <[EMAIL PROTECTED]> on 08/03/2001 15:55:51
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: RE: Minimizing Action class proliferation
Jeff,
I do understand the flip side of the issue. In our environment, one developer
"owns" what would be considered the related actions. In any case, CVS does a
great job of handling multiple developers working on the same file. As far as a
common base class goes, well Java doesn't support multiple inheritance and you
pretty much already have to extend Action.
All I'm striving for is a little bit of balance between lots of little files,
the only difference between them being their class name and the method they call
on the bean; and the need for flexibility.
Donnie
>>> [EMAIL PROTECTED] 03/08/01 10:47AM >>>
>From: DONNIE HALE [mailto:[EMAIL PROTECTED]]
>
>Thanks for responding. I understand what you're saying re:
>keeping the action classes simple. However, it still makes the
>whole cycle more tedious than perhaps it needs to be. It's
>harder to write "helper" methods, perhaps for bean
>manipulation, that can be shared across action classes. In the
>real world, where revision control is being used, you have to
>make sure to check all the action classes in. And so on.
>Further, the smaller those action classes are, the more
>painful it is to have to put each in a separate source file.
Hey, you could implement your *entire* application as a single java file
with inner classes! Wouldn't that be convenient!
I don't quite understand the problem with lots of small files. It seems
to me that this is a good thing. If you want helper methods, put them
in a common base class.
If you want version control pain, try having 15 developers all working
on a single file :-)
Jeff
--------------------- End of message text --------------------
The principal place of business of PricewaterhouseCoopers and its associate
partnerships is 1 Embankment Place, London WC2N 6NN where lists of the
partners' names are available for inspection. All partners in the associate
partnerships are authorised to conduct business as agents of, and all
contracts for services to clients are with, PricewaterhouseCoopers. The UK
firm of PricewaterhouseCoopers is authorised by the Institute of Chartered
Accountants in England and Wales to carry on investment business.
PricewaterhouseCoopers is a member of the world-wide
PricewaterhouseCoopers organisation.
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to which
it is addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the
intended recipient is prohibited. If you received this in error, please
contact the sender and delete the material from any computer.