Law-of-Demeter

Message Chains

One line prices a seat through five classes, and a small change breaks six screens. Learn to spot Message Chains, fix them with Hide Delegate or Move Method, and tell them from fluent calls.

November 26, 20268 minutes

Feature Envy

A method that keeps reaching into another class's data wishes it lived somewhere else. Learn to spot Feature Envy and fix it with Move Method: put behavior next to the data it uses.

November 24, 202611 minutes