recall

← recall

feature envy termsmell

method that uses another class's data more than its own

A method on class A reaches into class B's fields and computes something. The method 'envies' B's features and probably belongs there, not on A. Telltale of misplaced responsibility. Fix: move the method to where the data is.

topics: refactoring, engineering-judgment

references: