Back to Catalog
Code Smells
Couplers
Inappropriate Intimacy
Classes that know too much about each other's internal details.
Intent & Description
'
π― Intent
Identify classes that delve too deeply into each other’s private implementation.
π Context
Classes access each other’s private fields or methods directly, creating tight coupling and making changes difficult.
π‘ Solution
Improve encapsulation, move methods to appropriate classes, or introduce interfaces to reduce coupling.'
Real-world Use Case
Use when classes are too familiar with each other’s internals.
Source
π TL;DR
Classes shouldn’t know each other’s private details. Improve encapsulation and reduce coupling.