0

In the answer to this question and others, the guidance is to favor composition over inheritance when the relationship is a "has-a", and inheritance when "is-a".

One of the main benefits to composition seems to also the ability to build any combination of behaviors at any level of an equivalent inheritance tree, without changing the definition of any other classes.

Is this true?

cppProgrammer
  • 349
  • 1
  • 2
  • 12

0 Answers0