On 5/31/06, Joost Diepenmaat <joost / zeekat.nl> wrote:
> On Thu, Jun 01, 2006 at 03:57:08AM +0900, Alexandru Popescu wrote:
> > At least in Java these modifiers are quite usefull: a protected method
> > is one that offers extensibility/polymorphic behavior for hierarchies,
> > without exposing it as public API. So the behavior may vary according
> > to the implementation, and the exposed API/public methods are a
> > completely different thing.
>
> That's only true if you also find some way to stop the "public" from
> inheriting from your base classes too, and I cann't think of any language
> that allows you to do that.
>
> Protected methods *are* part of the public API anyway - might as
> well admit it and make them public and put a big disclaimer in the
> docs.
>
> Joost.
>

Not sure I am getting your argument. For inheritance this is the exact
needed behavior. Any external object will still be not able to call
these methods. So they are providing a way to customize your internal
implementation when working with hierarchies, but not offer it as an
API method.

./alex
--
.w( the_mindstorm )p.

>
>