Design Patterns · Middle · Question 32 of 75
What is feature envy?
- ✓Correct answer: A function works more with another object's data than with its own
- 2A function copied into different modules because it's so useful
- 3A function that calls itself recursively too often
Explanation
If an OrderView method keeps reaching into customer's fields and computing things from them, the logic should move closer to the data - into the customer module. This increases cohesion and simplifies changes.