Object-oriented programming: an objective sense of style
Authors:
Open Access
- 1 January 1988
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 23 (11) , 323-334
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.Keywords
This publication has 5 references indexed in Scilit:
- Object-oriented programming with class dictionariesHigher-Order and Symbolic Computation, 1988
- Common Lisp Object System specificationACM SIGPLAN Notices, 1988
- A Taste of SmalltalkIEEE Computer Graphics and Applications, 1986
- An introduction to Trellis/Owl1986
- Proof of correctness of data representationsActa Informatica, 1972