Table of Contents

Law of Demeter (LoD)

Variants and Alternative Names

Context

Principle Statement

“A method of an object should invoke only the methods of the following kinds of objects:

  1. itself
  2. its parameters
  3. any objects it creates/instantiates
  4. its direct component objects”1)

Description

Rationale

Strategies

Caveats

See section contrary principles.

Origin

Evidence

Relations to Other Principles

Generalizations

Specializations

Contrary Principles

Complementary Principles

Principle Collections

Examples

Description Status

Stub

Further Reading

Discussion

Discuss this wiki article and the principle on the corresponding talk page.