You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/04/13 16:50:56 UTC
"final" keywords in ant integration sources?
Hi Chris,
I am not sure I understand why we have added "final" keywords to all
methods in the ant integration sources. I understand what the meaning is
(no one is allowed to extend the classes), but I don't understand why?
I would prefer not marking these API as "public" in a document somewhere
(in the class, as javadoc, for example), but I don't quite understand
the rationale for enforcing that. I'd rather have it open and let
someone extend the classes if they need, provided they know they are not
public APIs.
BTW, why wouldn't they be public APIs?
Thanks
-Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
RE: "final" keywords in ant integration sources?
Posted by Vincent Massol <vm...@pivolis.com>.
> -----Original Message-----
> From: Christopher Lenz [mailto:cmlenz@gmx.de]
> Sent: 13 April 2003 23:23
> To: Cactus Developers List
> Subject: Re: "final" keywords in ant integration sources?
>
> Vincent Massol wrote:
> > Hi Chris,
> >
> > I am not sure I understand why we have added "final" keywords to all
> > methods in the ant integration sources. I understand what the
meaning is
> > (no one is allowed to extend the classes), but I don't understand
why?
> >
> > I would prefer not marking these API as "public" in a document
somewhere
> > (in the class, as javadoc, for example), but I don't quite
understand
> > the rationale for enforcing that. I'd rather have it open and let
> > someone extend the classes if they need, provided they know they are
not
> > public APIs.
> >
> > BTW, why wouldn't they be public APIs?
>
> I'd consider the classes in o.a.c.integration.ant.webxml good for
public
> use, and can imagine cases where one might even want to extend from
> them. However, the methods that I declared final are really not
intended
> to be overridden by subclasses. The effect of making them final is, in
> essence, that one can add behaviour to the classes, but not modify the
> existing behaviour. Note that I *didn't* make the classes themselves
> final.
>
yep. That's definitely better than making the class final. How I hate
the fact that the URL class is final! :-)
> FYI, these changes result from me playing with the
> "DesignForInheritance" check that has been added to Checkstyle HEAD,
and
> that has been heavily inspired from item 15 in Bloch's excellent
> "Effective Java": Design and document for inheritance or else prohibit
> it. Pretty good advice IMHO, although not universally applicable.
Ok, now I understand where your commit message comes from... :-) I guess
I need to read Joshua's book.
Thanks
-Vincent
>
> --
> Christopher Lenz
> /=/ cmlenz at gmx.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
Re: "final" keywords in ant integration sources?
Posted by Christopher Lenz <cm...@gmx.de>.
Vincent Massol wrote:
> Hi Chris,
>
> I am not sure I understand why we have added "final" keywords to all
> methods in the ant integration sources. I understand what the meaning is
> (no one is allowed to extend the classes), but I don't understand why?
>
> I would prefer not marking these API as "public" in a document somewhere
> (in the class, as javadoc, for example), but I don't quite understand
> the rationale for enforcing that. I'd rather have it open and let
> someone extend the classes if they need, provided they know they are not
> public APIs.
>
> BTW, why wouldn't they be public APIs?
I'd consider the classes in o.a.c.integration.ant.webxml good for public
use, and can imagine cases where one might even want to extend from
them. However, the methods that I declared final are really not intended
to be overridden by subclasses. The effect of making them final is, in
essence, that one can add behaviour to the classes, but not modify the
existing behaviour. Note that I *didn't* make the classes themselves final.
FYI, these changes result from me playing with the
"DesignForInheritance" check that has been added to Checkstyle HEAD, and
that has been heavily inspired from item 15 in Bloch's excellent
"Effective Java": Design and document for inheritance or else prohibit
it. Pretty good advice IMHO, although not universally applicable.
--
Christopher Lenz
/=/ cmlenz at gmx.de
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org