Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M0278

Feature Envy

Feature Envy
SystemsmediumSystems Theory
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

A type of code smell

Definition

A type of code smell. It refers to a module (or a person) that excessively focuses on and frequently accesses another module's data, as if it would rather live in that module. This usually indicates unclear division of responsibilities. Scaffold use: boundary review. If you find yourself always making decisions that should be made by others (or other departments), or always cleaning up after others, you have 'Feature Envy'. Return responsibilities to the correct owner.

How to use

Boundary review. If you find yourself always making decisions that should be made by others (or other departments), or always cleaning up after others, you have 'Feature Envy'. Return responsibilities to the correct owner.

Mechanism

Feature Envy is a code smell: when module A frequently reads module B's data and performs calculations on it, it indicates that the 'data' and the 'logic that operates on the data' should belong together, and the division of responsibilities is misplaced. The same applies at the organizational level—if one entity always makes decisions for another, it means the boundaries of authority and responsibility are misaligned.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Class A heavily reads fields of class B and performs calculations (should move the method to B); departments covering for each other, blurred boundaries leading to buck-passing and duplicated work.

Common pitfalls

  • Misinterpreting frequent cross-boundary access as 'collaboration'; continuously adding methods to the wrong owner; ignoring boundaries and single responsibility.
Sources

Source support: Explicit

  • link
    kpcq.org.cnhttps://www.kpcq.org.cn/kitchen/458/419012958.shtmlZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS