Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Parallel Inheritance Hierarchies
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
Every time you make a subclass of one class, you also have to make a subclass of another. You can recognize this smell because the prefixes of the class names in one hierarchy are the same as the prefixes in another hierarchy.
Symptoms
- Creating subclass in one hierarchy requires subclass in another
- Class name prefixes match across hierarchies
- Two hierarchies grow in parallel
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)