Formulations and benefits of the law of demeter

  • Authors:
  • K. J. Lienberherr

  • Affiliations:
  • Northeastern University, College of Computer Science, Cullinane Hall, 360 Huntington Ave., Boston MA

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

Our initial ideas on preventive maintenance of object-oriented systems were presented in [LHR88] which describes a set of guidelines called the "Law of Demeter". As a result of this publication we have received much feedback, as well as a detailed critique from [Sak89]. In this paper we expand on the initial ideas and present a new perspective with which to view the Law. This perspective is based on client/supplier relationships between methods and classes and allows a cleaner description of the benefits of the Law. This paper is also a reply to [Sak89] which was pointing out that the formulation of the Law for C++ needs additional work.At first sight, the idea of any rules or principles being superimposed on the creative mind seems more likely to hinder than to help, but this is really quite untrue in practice. Disciplined thinking focusses inspiration rather than blinkers it.