Hmm….I appreciate the explanation. However, I understand Eric’s position about composition more than I do your position about stampit being the same as class inheritance, sorry to say.
> If you use inheritance according to his rules, then he calls that object composition.
That’s not what he said. He said:
> All object composition is a form of inheritance. The question is, are we inheriting the class, or are we inheriting component parts to form a larger whole?
There is an important point in that. “are we inheriting component parts to form a larger whole”.
The goal with composition is to create has-a relationships between the objects. Class hierarchies can only create is-a relationships. That is the evil of “extends” and the coupling it causes with child/parent relationships or even worse, deeper hierarchies.
Try creating has-a relationships with multiple classes by extending them. It simply won’t work. With stampit, you can combine multiple objects (for code reuse) and avoid delegation chaining/ inheritance between them. That is the pragmatism and best practice being offered with stampit.