Assuring good style for object-oriented programs
- 1 September 1989
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Software
- Vol. 6 (5) , 38-48
- https://doi.org/10.1109/52.35588
Abstract
The language-independent Law of Demeter, which encodes the ideas of encapsulation and modularity in an easy-to-follow form for object-oriented programmers, is presented. The law was developed during the design and implementation of the Demeter system, which provides a high-level interface to class-based, object-oriented systems. Two forms of the law, the class and object forms, are described. Its motivation is to ensure that the software is as modular as possible. Principles covered by the law include coupling control, information hiding, information restriction, information localization, and structured induction. An example is given to show how the law is applied, and valid violations are identified. It is shown how to transform a method that does not satisfy the law into one that does.<>Keywords
This publication has 5 references indexed in Scilit:
- Demeter: a case study of software growth through parameterized classesPublished by Institute of Electrical and Electronics Engineers (IEEE) ,2003
- Comments on “the law of demeter” and C++ACM SIGPLAN Notices, 1988
- Object-oriented programming with class dictionariesHigher-Order and Symbolic Computation, 1988
- Object-oriented programming: an objective sense of stylePublished by Association for Computing Machinery (ACM) ,1988
- The Modular Structure of Complex SystemsIEEE Transactions on Software Engineering, 1985