1

Is there a story from Greek mythology about the goddess Demeter that somehow motivates the Law of Demeter? If so, I'd love to know it so I can tell it to my students when I teach this topic.

  • This might be more on-topic on English Language & Usage, Computer Science Educators, History, or Mythology (see each site's scope) but I don't really think it's on-topic here. – heather Jul 8 '18 at 2:24
  • 2
    See also wikipedia: "It is so named for its origin in the Demeter Project, an adaptive programming and aspect-oriented programming effort. The project was named in honor of Demeter, “distribution-mother” and the Greek goddess of agriculture, to signify a bottom-up philosophy of programming which is also embodied in the law itself." [citation-needed], though, so take it with a grain of salt. – heather Jul 8 '18 at 2:25
  • If you're a teacher, I suggest strongly to teach "the principle of least knowledge": the principle is then self explanatory (Like each of the SOLID principles) and you can focus on what really matters. In the LoD, the idea is combined with other principles which are no longer of general truth: a class may nowadays talk to perfect strangers as long as it doesn't rely on their internals but only their public interface. – Christophe Jul 8 '18 at 9:10
4

The Law of Demeter for Functions ("Only talk to your friends") aka the Principle of Least Knowledge and the related Law of Demeter for Concerns ("Only talk to your friends who share your concerns") were first explicitly discovered, described, defined, and named in the Demeter Project. Not only were the Laws discovered there, they are also part of the Demeter Method and thus a guiding design principle for the entire Demeter System. That's why the researchers decided to name it after the system.

As to why the system is named the Demeter System, there is this quote on the What is Demeter? site:

Agriculture

The Greek goddess of Agrigulture.

The Demeter project was named after Demeter because we were working on a hardware description language Zeus and we were looking for a tool to simplify the implementation of Zeus. We were looking for a tool name related to Zeus and we chose a sister of Zeus: Demeter.

Later we promoted the idea that Demeter-style software development is about growing software as opposed to building software. We introduced the concept of a growth plan which is basically as sequence of more and more complex UML class diagrams. Growth plans are useful for building systems incrementally.

So, essentially the name was first chosen for its coolness factor, and then the association to "growing software in small steps" was ret-conned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.