• DocumentCode
    1235790
  • Title

    Assuring good style for object-oriented programs

  • Author

    Lieberherr, Kari J. ; Holland, Ian M.

  • Author_Institution
    Comput. Sci. Coll., Northeastern Univ., Boston, MA, USA
  • Volume
    6
  • Issue
    5
  • fYear
    1989
  • Firstpage
    38
  • Lastpage
    48
  • 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
    object-oriented programming; programming environments; user interfaces; Demeter system; Law of Demeter; class forms; coupling control; encapsulation; good style; high-level interface; information hiding; information localization; information restriction; modularity; object forms; object-oriented programs; structured induction; Encapsulation; Programming profession;
  • fLanguage
    English
  • Journal_Title
    Software, IEEE
  • Publisher
    ieee
  • ISSN
    0740-7459
  • Type

    jour

  • DOI
    10.1109/52.35588
  • Filename
    35588