daily weblogs

books

recommended books

other reading

books by category

music on CD

reference

java study group

web design

webinfo (links)

about

adventure

recipes

photos

about us

buy a book at amazon

Law of Demeter . . . . . oct 15 2002 — sg1.dat

At our java study group meeting, we were discussing object cloning, and the Law of Demeter in object-oriented software development came up. The idea was expressed that as a consequence of the Demeter principle, you would not want to surface your objects, but instead surface your services. Demeter is the Greek goddess of grain, or more generally agriculture, so you might say the metaphor of 'growing' object-oriented software would be inspired by the law of Demeter. However, by reading about...

The Law of Demeter you would find that notion to be incorrect, except as an expression of one type of very general metaphor for software development.

The law of Demeter is so-called only because the formulators were working at the time on a project they called the Demeter project. Why? They were looking for a name to associate it with the 'Zeus' project. Demeter was a sister of Zeus. So the law, "that a method should access data passed as arguments, linked via associations, or obtained via calls to operations on other neighbouring data", has nothing to do with the fact that Demeter is the mother of Persephone, or the goddess of grain, or any other details of her mysterious, fascinating, and considerable mythology.

At our next meeting, either in one week's time or in two week's time, we will be discussing Chapter 6, Reflection Idioms, and Chapter 7, Concurrency idioms, from Java Performance and Idiom Guide by Craig Larman and Rhett Guthrie. And we will be discussing the Law of Demeter too.

pools=XML, Blog, Ruby

If you like what you read, click here to sign up for our mailing list and we'll notify you when we post new book reviews


all text and images © Copyright 1997-2003 George D. Girton.
All Rights Reserved.