Law of Demeter
- The law: A method should only use objects that are
- instance fields of its class
- parameters
- objects that it constructs with new
- Shouldn't use an object that is returned from a method call,
that is, an object that is part of another object's state.
- Rule of thumb, not a mathematical law
- Demeter = Greek goddess of agriculture, sister of Zeus