Skip to content
nsuttle edited this page Sep 7, 2015 · 3 revisions

Train wreck code ( nested getters )

a.getB().getC().getD().setEnabled(true);

Problem: clients of a know about the internal structure, coupling. Prefer

a.enabledCD();  //replace CD with meaning in the domain
Clone this wiki locally