Fat Class Hierarchies

The opposite to DeepClassHierarchies. An AntiPattern.

Occurs when the class hierarchy is more fat than deep. This does not mean that classes are fat, but there are some classes from which several classes inherit. Those superclasses become hard to change, since so many classes depend directly from them.

Sometimes results in the FragileBaseClassProblem.

Use of this (anti)pattern is sometimes appropriate, if the parent is not expected to change at all. In this case, the cost of change is moot, as it's never paid. Many interfaces HaveThisPattern, as interface is usually seen as more stable than implementation.

What about java.lang.Object? or NSObject in Cocoa?

They are covered by the "parent is not expected to change" case.


EditText of this page (last edited July 30, 2004) or FindPage with title or text search