Affiliation:
1. 161 Cullinane Hall, College of Computer Science, Northeastern University, 360 Huntington Ave., Boston MA
Abstract
We introduce a simple, programming language independent rule (known in-house as the Law of Demeter™) which encodes the ideas of encapsulation and modularity in an easy to follow form for the object-oriented programmer. You tend to get the following related benefits when you follow the Law of Demeter while minimizing simultaneously code duplication, the number of method arguments and the number of methods per class: Easier software maintenance, less coupling between your methods, better information hiding, narrower interfaces, methods which are easier to reuse, and easier correctness proofs using structural induction. We discuss two important interpretations of the Law (strong and weak) and we prove that any object-oriented program can be transformed to satisfy the Law. We express the Law in several languages which support object-oriented programming, including Flavors, Smalltalk-80, CLOS, C++ and Eiffel.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference17 articles.
1. D. Bobrow L. G. D. Michiel R. P. Gabriel S. E. Keene G. Kiczales and D. A. Moon. Common Lisp Object System Specification. March 1988 1988. Draft submitted to X3J13. D. Bobrow L. G. D. Michiel R. P. Gabriel S. E. Keene G. Kiczales and D. A. Moon. Common Lisp Object System Specification. March 1988 1988. Draft submitted to X3J13.
Cited by
26 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献