Model review and simulation > Reviewer > Provided PTC reviews > Style reviews > Inheritance depth (Reviewer Review)
Inheritance depth (Reviewer Review)
Reports the classes if the depth of their inheritance trees exceeds a value specified in your standards.
Consequences
Deep inheritance trees can be harder to maintain, as a change in base classes will impact all derived classes. Subclasses also carry around the attributes of the parent classes and this can lead to bloat.
Deep inheritance hierarchies can also be a symptom of over designing a solution.
Strategy
Inheritance is very powerful, but with great power comes great responsibility.
If the inheritance is justified then ignore the review item.
Was this helpful?