Object Design
Roles, contracts, collaboration, and construction decisions for code that must keep changing.
- Single Responsibility Is About Change, Not Class Size
- Open–Closed Protects Stable Policy from Repeated Variation
- Substitution Is a Behavioral Contract
- Interfaces Belong to Their Clients
- Dependency Inversion Lets Policy Own the Boundary
- Composition Over Inheritance Is a Decision, Not a Rule
- Strategy Chooses How; Command Records What to Do
- Tell, Don't Ask Means Keep the Decision with the State
- The Law of Demeter Is About Knowledge, Not Dots
- A Null Object Should Mean Nothing Happened
- A Constructor Should Leave a Usable Object