Assuring good style for object-oriented programs

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.<<ETX>>

[1]  Paul Clements,et al.  Enhancing reusability with information hiding , 1989 .

[2]  Karl J. Lieberherr,et al.  Object-oriented programming with class dictionaries , 1988, LISP Symb. Comput..

[3]  Grady Booch,et al.  Object-Oriented Design with Applications , 1990 .

[4]  Rebecca Wirfs-Brock,et al.  Object-oriented design: a responsibility-driven approach , 1989, OOPSLA '89.

[5]  Timothy A. Budd,et al.  An introduction to object-oriented programming , 1991 .

[6]  Ian M. Holland,et al.  Object-oriented programming: an objective sense of style , 1988, OOPSLA 1988.

[7]  Ted Kaehler,et al.  A Taste of Smalltalk , 1986 .

[8]  J LieberherrKarl,et al.  Assuring Good Style for Object-Oriented Programs , 1989 .

[9]  Markku Sakkinen,et al.  Comments on “the law of demeter” and C++ , 1988, SIGP.

[10]  Alan Snyder,et al.  Inheritance and the Development of Encapsulated Software Systems , 1987, Research Directions in Object-Oriented Programming.

[11]  Barbara Liskov,et al.  Abstraction and Specification in Program Development , 1986 .

[12]  David W. Embley,et al.  Assessing the quality of abstract data types written in Ada , 1988, Proceedings. [1989] 11th International Conference on Software Engineering.

[13]  Karl J. Lieberherr,et al.  Demeter: a case study of software growth through parameterized classes , 1988, Proceedings. [1989] 11th International Conference on Software Engineering.

[14]  Carl Hewitt,et al.  Laws for Communicating Parallel Processes , 1977, IFIP Congress.

[15]  David Lorge Parnas,et al.  The Modular Structure of Complex Systems , 1984, IEEE Transactions on Software Engineering.