DOI QR코드

DOI QR Code

Type Object Class에 의한 Type Object 디자인 패턴의 런타임 클래스 참조문제의 해결

Resolving the Runtime Class Reference Problem of the Type Object Design Pattern by Type Object Class

  • 김윤호 (안동대학교 전자정보산업학부)
  • 발행 : 2007.03.31

초록

Type Object 디자인 패턴은 하나의 클래스가 수많은 하위 클래스를 갖거나, 그 하위 클래스의 개수를 소프트웨어 개발시에 예측할 수 없는 상황을 해결하고자 제시된 패턴이다. 그러나, 이 패턴은 적용력과 여러 장점에도 불구하고 인스턴스를 생성하는 클래스와 그 인스턴스의 실제적 클래스가 분리되어 있고 또한 객체 레퍼런스에 의해서 서로 연관되어 있으므로 이에 대한 관리를 위한 메커니즘과 패턴의 이해에 있어서 많은 복잡성을 갖는 문제점이 있다. 본 논문에서는 이러한 문제를 해결하기 위한 Type Object Class의 설계와 구현을 제시한다. 즉, Type Object 패턴의 Type Class와 Object Class로부터 Type Object Class를 설정하고, 이를 런타임에 생성되고 사용되게 함으로써, 인스턴스들이 객체 지향프로그래밍 언어에서 제공하는 고유의 클래스를 참조하게 되어 별도의 클래스 참조 메커니즘을 가질 필요가 없도록 하였다. 따라서, 별도의 클래스 참조 메커니즘을 개발하는 부담과 이 메커니즘의 동작으로 인한 실행 상의 성능 저하의 문제가 개선되는 효과가 있다.

The Type Object Design Pattern is proposed to provide a solution on the situation in the case that one class has too many subclasses or the number of subclasses are undefined. Although this pattern has many advantages in terms of applicability and dynamic object behavior, it has a weak point in runtime pattern operation that it has to build and maintain a class reference mechanism in runtime to reference the class (de facto 'object') of instances. To solve that problem, this paper addresses the solution of the runtime class reference problem of Type Object Pattern. it defines a new class of Type Object Class (TOC) from Type Class and Object Class in Type Object pattern and presents the methods of creating, compiling, and memory-loading the TOC. It depends on built-in class reference mechanism of object-oriented programming language, and is not necessary to fit with the additional mechanism. Consequently, we need not to set up the additional class reference mechanism and system performance is enhanced due to it.

키워드

참고문헌

  1. Coad, P., 'Object-Oriented Patterns,' CACM, vol. 35, no. 9, 1992
  2. Gamma, Richard, Ralph, and Vlissides, Design Patterns - Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995
  3. Johnson and Woolf, 'Type Object,' Pattern Languages of Programming, vol. 3, pp.47-65, Addison-Wesley 1997
  4. Hunter and Thomas, The Pragmatic Programmer, Addison-Wesley, 2000
  5. Rettig and Fowler, 'Reflection vs. Code Generator,' Java World Magazine, vol. 6, no. 11, 2001
  6. Rumbaugh, Jacboson, and Booch, The Unified Modeling Language Reference Manual, Addison-Wesley, 1999
  7. Odell, J., 'Object Types as Objects and Vice Versa,' Journal of Object-Oriented Programming, vol.4, Issue 6, 45-48, 1992
  8. Martin and Odell, Object-Oriented Methods: A Foundation, Prentice-Hall, 1998
  9. Kiczales, Rivieres, and Bobrow, The Art of the Metaobject Protocol, MIT press, 1991
  10. James Noble, 'Prototype-Based Object System,' Pattern Languages of Programming, vol. 4, 53-71, 2000