Comment on Why composition is often better than inheritanceparentComments−achr212yYour wikipedia link actually does a good job of showing why the composition shown in the article is poorly conceived. The whole point of 'composition over inheritance' is that your object is still polymorphic on the composed-of classes.−chton12ythat's a good point, in the process of trying to use composition the author has made a (very) leaky abstraction.
Comments
Your wikipedia link actually does a good job of showing why the composition shown in the article is poorly conceived. The whole point of 'composition over inheritance' is that your object is still polymorphic on the composed-of classes.
that's a good point, in the process of trying to use composition the author has made a (very) leaky abstraction.