Inheritance is the tightest coupling you can have, bad usage of it leads to highly-coupled and lowly-cohesive code. 99% of the things you want to do with inheritance can be done with composition so you should always favor composition over inheritance. Architecture relying on inheritance is far from being good and clean.

14m read timeFrom betterprogramming.pub
Post cover image
Table of contents
S.O.L.I.D.Liskov Substitution PrincipleS ingle Responsibility PrincipleDependency Inversion PrincipleInterface Segregation PrincipleOpen-Closed Principle
1 Comment

Sort: