Wednesday, September 19, 2007

Only talk to your immediate friends

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.

This is used in designing object oriented systems.

The LoD is a more specific case of the Low Coupling Principle well-known in software engineering. The Low Coupling Principle is very general.

No comments: