I would vote for subclassing :
1. It's the core of OOP to share common pieces of code in a parent class.
2. A bean is not a library. A bean should be seen as an independant entity which can have a life by itself ...
IMHO ;-)

Willem van Asperen wrote:

Hello,

I have a set of pages that have very similar behavior. They have listeners like 
"handleTransition" and "startNewProcess". The first implementation I did was, 
obviously, to capture all these general functionality into XXX a subclass of BasePage and then sub 
class my page classes YYY from there.

Now I can DirectLink to these general listeners directly.

But -- is that the natural way to implement this? Should I not capture the general 
functionality into a bean that is "injected" into the page? But do I then need 
to manually wire the listener of the page to the bean's methods?

Is there a way to <page-description> for the XXX page, such that these are true 
for all descendents of it?

Thanks for your thoughts,

Regards,

Willem van Asperen

PA Consulting Group
Innovation. Responsiveness. Delivery.
Coltbaan 33
P.O. Box 1043
3430 BA Nieuwegein
The Netherlands
+31652015182
http://www.paconsulting.com/

DISCLAIMER:  This document should only be read by those persons to whom it is 
addressed and is not intended to be relied upon by any person without 
subsequent written confirmation of its contents.  PA Consulting Group disclaims 
all responsibility and accepts no liability (including in negligence) for the 
consequences of any person acting, or refraining from acting, on such 
information prior to the receipt by those persons of subsequent written 
confirmation.  If you have received this e-mail message in error, please notify 
us immediately by telephone on +31302829600.  Please also destroy and delete 
the message from your computer.  Any form of reproduction, dissemination, 
copying, disclosure, modification, distribution and/or publication of this 
e-mail message is strictly prohibited.


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


--
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06

Reply via email to