Re: Maximum Accepted Layers/Levels of inheritance
On Sep 11, 7:49 pm, Phlip <phlip2...@gmail.com> wrote:
James Kanze wrote:
Start with the book /Design Patterns/, generally to learn what
the "point" of all this OO stuff is. You will notice most
patterns use only 2 layers of inheritance...
The key above is "most patterns".
I wrote that because I didn't have /DP/ to hand. I suspect
that no pattern in /DP/ has more than two layers, and I
suspect this answers the OP. 2.
I suspect that as well, although I once used a pattern which
required 4. (It was a very special case, however, and related
to the fact that we were generating much of the code
automatically.) And mixins require a minimum of 3, and 4 often
makes them clearer. What I was really meant to get at, however,
is that when you compose patterns, you will often end up with 3
or maybe 4 levels. It's not a problem *IF* the patterns
involved and the composition is clear.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34