The Law of Demeter for functions states:

A method "M" of an object "O" 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

Demeter is a research project at Northeastern University, lead by Dr. Karl Lieberherr. The term "Law of Demeter" refers to the paper "Assuring good style for object-oriented programs " by Lieberherr, Karl. J. and Holland, I., Which appeared in IEEE Software, in 1989.