Description:
Law of Demeter
Definition 1 (Client) Method M is a client of method f attached to class C, if inside M message f is sent to an object of class C, or to C. If f is specialized in one or more subclasses, then M is only a client of f attached to the highest class in the hierarchy. Method M is a client of some method attached to C.
Definition 2 (Supplier) If M is a client of class C then C is a supplier to M. In other words, a supplier class to a method is a class whose methods are called in the method.
Definition 3 (Acquaintance Class) A class C1 is an acquaintance class of method M attached to class C2, if C1 is a supplier to M and C1 is not one of the following:
Definition 4 (Preferred-acquaintance Class) A preferred-acquaintance class of method M is either:
Realization note. Direct creation means that a given object is created via operator new.
Definition 5 (Preferred-supplier class) Class B is called a preferred-supplier to method M (attached to class C) if B is a supplier to M and one of the following conditions holds:

The relation among the different types of supplier classes.
The class form of Demeters Law has two versions: a strict version and a minimization version. The strict form of the law states that every supplier class of a method must be a preferred supplier.
The minimization form is more permissive than the first version and requires only to minimize the number of acquaintance classes of each method.
Observations.
Violations of Demeters Law - VOD
The definition of this metric is based on the minimization form of the Law of Demeter.
Based on the concepts defined there, and remembering that the minimization form of Demeters Law requires that the number of acquaintance classes should be kept low, we define the VOD metric.Definition 6 (VOD Metric) Being given a class C and A the set of all its acquaintance classes,
VOD(C) = |A|
Informally, VOD is the number of acquaintance classes of a given class.
Keeping the VOD value for a class low offers a number of benefits, enumerated below:
Source: Ing. Radu Marinescu. An Object Oriented Metrics Suite on Coupling. Universitatea "Politehnica" Timisoara, Facultatea de Automatica si Calculatoare, Departamentul de Calculatoare si Inginerie Software. September, 1998.