|
Re: Extends is evil?
bluke wrote:
> What do smalltalkers think
> about implementation inheritance?
A characteristic of implementation inheritance
called "YO-YO effect" has been discussed in
OO literature already a long time ago. It's a
good thing the Java folks are catching up :-)
Yo-yo effect refers to the fact that in an
(implementation) inheritance hierarchy the
control jumps up and down, down and up etc.
This makes it that much more difficult to
understand what is going on.
Nevertheless most of us do use implementation
inheritance, for the benefits it brings.
One way to minimize problems and risks with
implementation inheritance is to use the BRIDGE
design pattern: Separate public methods and
private implementation methods into *separate*
hierarchies.
Thus BRIDGE is somewhat a middle path between
pure implementation inheritance and pure
delegation approaches.
Google: OO yo-yo effect objects ECOOP
-Panu Viljamaa
|