Formulations of the Law of Demeter in the Object Oriented Programming

객체지향 프로그래밍에서의 Demeter 법칙의 정식화

  • 황석형 (일본오사카대학 정보공학과) ;
  • 이용근 (서울산업대학교 전자계산학과) ;
  • 양해술 (강원대학교 전자계산학과)
  • Published : 1994.05.01

Abstract

In the last years, several articles have been devoted to the study of the Law of Demeter in the object oriented programming. The Law of Demeter is a style rule that aims at eliminating unnecessary coupling among classes. Although a large number of studies have been made on the informal definitions, little is known about the formulation of the Law of Demeter. In this article, we define three relationships among classes i.e. inheritance, aggregation and association, and formulate the Law of Demeter. We also propose the algorithms to decide whether a given program satisfies the law and to transform an unfulfilled program into a fulfilled one.

객체지향 프로그래밍에 있어서 클래스간의 불필요한 상호 의존관계를 줄이기 위한 프로그래밍 스타일에 관한 규칙으로써 Demeter의 법칙(The Law of Demeter)이 있다. 본 논문에서는 종래의 비형식적인 Demeter의 법칙을 실제의 프로그램에 적용, 평가하 기 위해 클래스간의 관계로써 계승과 집약, 그리고 관련을 형식적으로 정의하고, 그것 들을 이용하여 Demeter의 법칙을 정식화하였다. 또한 Demeter의 법칙을 만족하는지를 판정하는 알고리즘과 Demeter의 법칙을 위반한 프로그램에 대한 변환 알고리즘을 제안 하였다.

Keywords