Back to Catalog
Code Smells
Couplers
Feature Envy
Methods that seem more interested in other objects than the object they're in.
Intent & Description
'
π― Intent
Identify methods that extensively use another object’s data and methods.
π Context
A method calls many methods on another object, seemingly more interested in that object than its own class.
π‘ Solution
Move the method to the class it’s most interested in using Move Method refactoring.'
Real-world Use Case
Use when a method heavily uses another object’s data and behavior.
Source
π TL;DR
Methods that prefer other objects should be moved to those objects. Follow the data.