Liskov Substitution: Subtypes That Keep Their Promises
When a subclass surprises its callers, inheritance becomes a trap. Lesson 3 of Level 3: Object-Oriented Design.
Level 3 · Object-Oriented Design · Lesson 3 of 6
When a subclass surprises its callers, inheritance becomes a trap.
Continue learning
- Open/Closed: Add Features Without Editing Old Code — Previous lesson
- Interface Segregation & Dependency Inversion — Next lesson
- Level 3: Object-Oriented Design — Back to the level
All lessons in OO Design
- Single Responsibility: One Reason to Change
- Open/Closed: Add Features Without Editing Old Code
- Liskov Substitution: Subtypes That Keep Their Promises
- Interface Segregation & Dependency Inversion
- Composition Over Inheritance
- Encapsulation, Tell Don’t Ask & the Law of Demeter