Not a C ++ guy (you have professional experience working with large corporate systems in C #, java and ruby), but here are my 2 cents anyway
It is not black and white.
The problem with inheritance is that it introduces a tight connection. Worse, this connection usually occurs around the encapsulated state. Changes in superclasses can affect hierarchical inheritance hierarchies, creating subtle and difficult to predict errors.
Interface segregation completely wraps around these issues because it does not break encapsulation in the same way.
The good thing about inheritance is that sometimes you have an object model that is actually the same, just with very little change or addition. As long as this change is very clear, not covered by wide scope and is not an additional restriction (see circle-ellipse problem), code reuse will exceed a tight connection.
I stick to composition over inheritance as a rule, not the law.
Matt Briggs Oct 08 '10 at 5:31
source share