Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Middle Man
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
Half the methods of a class are delegating to another class. Encapsulation through delegation can go too far - it's time to talk to the object that really knows what's going on.
Symptoms
- Many methods just delegate to another class
- Class provides little value beyond forwarding calls
- Interface mirrors another class's interface
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)