Law of Demeter Flashcards Preview

TM354 Last Minute Revision > Law of Demeter > Flashcards

Flashcards in Law of Demeter Deck (1):
1

What is the Law of Demeter?

The Law of Demeter states that a method m in a class A should not send a message to another object unless that object is one of the following:

  1. an instance variable used in the method m
  2. a parameter to the method m
  3. an object created in the method m
  4. a global variable used in the method m