4 ms·
>Deep hierarchies of inheritance need to be carefully designed or they become a mess. Deep hierarchies of anything need to be carefully designed.
by jope12 6y ago
>Deep hierarchies of inheritance need to be carefully designed or they become a mess.
Deep hierarchies of anything need to be carefully designed.
- brixon 6y agoI try to use the rule of after three levels of inheritance or abstraction then it needs to be a black box and then you can reset your count.
- kwdc 6y agoThe flip side of my impromptu "rule" is that you can drop the "careful" part as long as you are comfortable with a little or a lot of mess. Obvious common sense lowers the tolerance. I wonder how others set their tolerance? My perspective is that most OO hoerarchies don't go too deep. I've seen 4-5 at rare extremes. Around 2-3 is common. I'm sure someone has encountered 10 or more. I shudder to think how well that turns out in practice.