2007-11-12

juan_gandhi: (Default)
2007-11-12 03:04 pm

Law of demeter

Intro:
The Law of Demeter for functions requires that a method M of an object O may only invoke the methods of the following kinds of objects:

1. O itself
2. M's parameters
3. any objects created/instantiated within M
4. O's direct component objects

In particular, an object should avoid invoking methods of a member object returned by another method.

[Poll #1087502]