Prefer Composition to Inheritance

Soroush Khanlou: But this is inelegant and we wish we could just force our users to subclass something so that we can hide this behavior away. But don’t fret! We have options outside of inheritance. To add behavior in a composition-friendly way, we use the Decorator pattern.[…]A particularly elegant note on this solution: the wrapper … Continue reading Prefer Composition to Inheritance