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.