
Principle Two: Keeping Objects Consistent

#177 - Simple Object-Oriented Design: Principles for Writing Maintainable Software - Mauricio Aniche
Topic 9 of 15
Published Jun 3, 2024 · Clip 26:25–32:06 (5:41)
Mauricio explains that object consistency means you can always trust an object's state (e.g., a shopping cart's total). Ensuring consistency should never be the client's responsibility; it should live in the entity itself when possible, or in an intermediate layer when database calls are needed. He advises not to fight your framework — accept its decisions and design around them, and notes that being fully decoupled from frameworks is usually unnecessary.