--- Oliver Zeigermann <[EMAIL PROTECTED]> wrote:
> On Wed, 02 Feb 2005 18:28:04 +1300, Simon Kitching <[EMAIL PROTECTED]> wrote:
> > My major concern is that if we are going to warn people not to implement 
> > the Action interface,
> > then what really is the point of providing it in the first place? As I said 
> > above, I just
> cannot
> > think of any situation where a class would want to be an Action *and* 
> > extend some other class.
>
> I am +1 for using an interface and the default (why abstract?)
> implementation like with Swing or SAX.

I don't get why we would ever warn people not to implement the interface,
beyond including JavaDoc that clarified what the behaviour contract is
for the various methods.  Part of a developer's job is to exercise
judgement about what they are or are not going to do in their implementation.
If the existing Action implementations and base class provides what a developer 
needs to do 99% of the time, they won't bother implementing the interface, but 
when they encounter that 1% scenario, its nice not to hit a brick wall.

Here is a concrete example of why you could want to implement the interface
and extend another class, I've actually had situations with the existing
Digester where I'd wished I could do that.  The one that I can recall now
was an instrumentation issue.  Doing debugging and performance tuning of
a suite of rules can be tedious because, currently, the only options are
either to watch a spew of logging messages or single-step your way through
all the callbacks in a debugger (PAIN).  If the major coupling points
in the Digester had been abstracted by interfaces, it would have been
easier to insert instrumentation proxies or EasyMock'd test implementations 
of classes at key points.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to