Friday, September 22, 2006

Law of Demeter

Few days ago, we had our User Group Session at Microsoft House, London and there one of our friend Ian Cooper presented 10 OOP practices, and he introduced us Law of Demeter, the term was new to me but it says true things about Object Oriented Programming,

The principle says:

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

  1. itself
  2. its parameters
  3. any objects it creates/instantiates
  4. its direct component objects
which is ofcourse a good practice..so have a look n keep rocking..