19
Insider Trading
Symptom
Modules reach into each other's internals to coordinate behavior, bypassing public interfaces.
Goal
Cooperation happens through narrow, explicit interfaces; secrets stay secret.
Smellier version
class A { _data; }
class B {
read(a) {
return a._data.value;
}
}Fresher versionclass A { value() { return this._data.value; } }
class B { read(a) { return a.value(); } }Savings
Module boundaries become real; tests exercise the public surface; refactoring is local.
Note
Coupling at the implementation level — refactoring one breaks the other in non-obvious ways.