Assuring Good Style for Object-Oriented Programs

  • Lieberherr K
  • Holland I
  • 54

    Readers

    Mendeley users who have this article in their library.
  • 93

    Citations

    Citations of this article.

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.

Get free article suggestions today

Mendeley saves you time finding and organizing research

Sign up here
Already have an account ?Sign in

Find this document

Authors

  • Karl J. Lieberherr

  • Ian M. Holland

Cite this document

Choose a citation style from the tabs below

Save time finding and organizing research with Mendeley

Sign up for free