Law of Demeter
← Back to Other Design Principles
Only talk to your immediate friends. A method should only call methods on its own object, its parameters, objects it creates, and its direct component objects. Minimizes coupling by reducing the chain of object navigation.
Key Properties
Related
- Encapsulation (reinforced by LoD)
- Tell Don’t Ask (related principle)