Back to Catalog
Code Smells
Couplers
Middle Man
Classes that do nothing but delegate to other objects.
Intent & Description
'
π― Intent
Identify classes that exist only to pass calls to other objects.
π Context
You have classes whose methods simply delegate to other objects without adding any value.
π‘ Solution
Remove the middle man using Remove Middle Man, or have the client call the delegate directly.'
Real-world Use Case
Use when classes only delegate to other objects without adding value.
Source
π TL;DR
Classes that only delegate add no value. Remove them or call the delegate directly.