|
Re: Extends is evil?
"Peter van Rooijen" <peter@vanrooijen.com> escribió en el mensaje
news:3f3407e0$0$49115$e4fe514c@news.xs4all.nl...
> "panu" <panu@fcc.net> wrote in message
> news:Se6dncTW1r_jQ6-iU-KYgw@fcc.net...
> > bluke wrote:
> >
> > > What do smalltalkers think
> > > about implementation inheritance?
>
> [snip]
>
> It seems that there is some confusion over what the term "implementation
> inheritance" actually means.
>
> Implementation inheritance refers to the situation where one class
inherits
> another, without a resonable subtyping relationship between the two.
>
> An example would be to think that a chess club is a set of people, and
> translating that into defining a class ChessClub that inherits Set.
Why? It has a set of people, why would that be a problem?
I think implementation inheritance is when a Dog is a Name, because instead
a Dog should have a Name. or a more real example: a Dog is a Cat that barks
instead of meows, so meow() calls bark().
>
> This is a mistake.
>
> And don't laugh at the example, I've seen code doing such things by
> programmers who were paid to write it (I've changed the example to protect
> the guilty ;-)).
>
> Regards,
>
> Peter van Rooijen
> Amsterdam
>
>
|