Inheritance is one of the most valuable concepts in object-oriented programming. It’s a way to categorize and reuse code by creating collections of
attributes and behaviors called classes, which can be based on previously created classes.
But abusing this concept by creating a deep inheritance tree can lead to complex and unmaintainable source code. Often, an inheritance tree
becoming too deep is the symptom of systematic use of "inheritance" when other approaches like "composition" would be better suited.
This rule raises an issue when the inheritance tree, starting from Object
, has a greater depth than is allowed.