Skip to content

Composition Over Inheritance

You should use composition over inheritance to reduce coupling.

Using inheritance is helpful, due to code reuse, it comes with drawback in form of tightly coupling derivatives with base classes which can lead to breaking changes in future and code harder to extend and maintain.