Encapsulation, Tell Don’t Ask & the Law of Demeter
Put behaviour next to the data it protects, and stop reaching through objects. Lesson 6 of Level 3: Object-Oriented Design.
Level 3 · Object-Oriented Design · Lesson 6 of 6
Put behaviour next to the data it protects, and stop reaching through objects.
Continue learning
- Composition Over Inheritance — Previous lesson
- Patterns Are Answers to Recurring Pain — Next lesson
- Level 3: Object-Oriented Design — Back to the level