language: en

Imposing The Law of Demeter and Its Variations

Partha pratim Pal
partha@cs.rutgers.edu
Naftaly H. Minsky
minsky@cs.rutgers.edu
Department of Computer Science Rutgers University
New Brunswick, NJ 08903
February 28, 1996

Abstract The Law of Demeter [4] is accepted as a useful design principle that promotes tightly encapsulated classes and reduced coupling. Principles like this are routinely adopted in real-life projects, however neither the programming languages nor the existing environments provide enough support for effective realization of these principles. It is our thesis that broad structural principles should be formally specified, strictly enforced, and relaxed whenever relaxation is in order. In this paper we show how this can be done under our darwin-E environment using, the Law of Demeter as an illustration.

keywords: Law of Demeter, Law-Governed Architecture, Software Engineering Principles, Enforcement.

1 Introduction