Spinsels op het web
actions » SearchLogin 124 articles • 07 Aug 2008

Article with comments

Wednesday, 15 Nov 2006

permalink Law of Demeter

The Law of Demeter, also known as the don't talk to strangers principle of low coupling in software design:

The Law of Demeter was originally formulated as a style rule for designing object-oriented systems. "Only talk to your immediate friends" is the motto. The style rule was discovered at Northeastern University in the fall of 1987 by Ian Holland.

A more general formulation of the Law of Demeter is: Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. Or: Each unit should only talk to its friends; Don't talk to strangers.

Basically it can be formulated like this:

A method of an object should use only the following kinds of objects:

  1. itself
  2. its parameters
  3. any objects it creates/instantiates
  4. its direct component objects

• Wrote irmen at 00:06 (edited 2×, last on 30 Nov 2006) | read 243× | Add comment

Comments (1)

1BahOB <a href="http://zcpurhltphij.com/">zcpurhltphij</a>, xoevuiqncybj, [link=http://cuzmasxifpmx.com/]cuzmasxifpmx[/link], http://skqglqqefusf.com/

• wrote uefyzhxrfw (ip) on 23 May 2008, 23:16  permalink


Write a comment

Your name  
E-mail   (only visible for blog owner)
Homepage
Text:

[b] [i] [u] [tt] [center] [code] [quote] [url] [url=] [img] [@] [@@] [@:]
detailed help about markup
You must answer the following to be able to submit.
Type the letters you see in the image.
(Unreadable? Click 'Preview' for a new one)

Process times: page=0.093 request=0.123 cpu=0.070