The Law of Demeter, also known as the don't talk to strangers principle of low coupling in software design:
The Law of Demeter was originally formulated as a style rule for designing object-oriented systems. "Only talk to your immediate friends" is the motto. The style rule was discovered at Northeastern University in the fall of 1987 by Ian Holland.
A more general formulation of the Law of Demeter is: Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. Or: Each unit should only talk to its friends; Don't talk to strangers.
Basically it can be formulated like this:
A method of an object should use only the following kinds of objects:
- its parameters
- any objects it creates/instantiates
- its direct component objects