Composition over Inheritance
aka Composite reuse Principle.
It is a OOP principle which encourages the usage of composition for code reuse instead of inheritance.
However, it is still a principle and a principle is just in principle.
Hence, this can be reframed better as -
If you are going to use inheritance - think again, chances are you need composition.
Trade-offs
- Purpose of Inheritance vs Disadvantages of Inheritance
- Benefits of Composition vs Disadvantages of Composition
References
Prefer composition over inheritance? - Stack Overflow
Backlinks