|
|
|
|
|
by charlysisto
3620 days ago
|
|
It's funny to see in the life cycle of every new language/framework in the block the rediscovery of good architectural patterns that can be summed up in one sentence:
- inheritance & mixin bad / composition good. Good article nevertheless. |
|
This wisdom is at least as old as the classic GoF book [1] which was published in 1994. Many of their patterns can be summarized as: "Favor 'object composition' over 'class inheritance'."
They also give a pretty simple, compelling reason for that: It is just a direct consequence of the even more fundamental principle:
"Program to an interface, not an implementation."
[1] Gang of Four (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides): "Design Patterns: Elements of Reusable Object-Oriented Software" https://en.wikipedia.org/wiki/Design_Patterns