Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Ancient Philosophers > The Law of Demeter

The Law of Demeter

The Law of Demeter was developed at Northwestern University in the late ’80s. It is best summarized by the phrase, “Only talk to your closest friends.” The idea is that any given object shouldn’t know anything about the internal details of the objects with which it interacts. The name of the law comes from the Roman goddess Demeter, the goddess of agriculture (and therefore of food distribution). Although she was not technically an ancient philosopher, her name makes her sound like one!

More formally, the Law of Demeter says that for any object and method, the only methods that should be invoked are the following:

  • The methods of the object itself


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint