Explicit metaclasses as a tool for improving the design of class libraries
Existing OO methodologies focus on instance behaviors and reduce the role of a class to object creation. In fact, these methodologies do not address the issue of class design itself.
Nevertheless, classes have their own properties, which are not related to the semantics of their instances. Examples of such properties are well-known and language independent: concrete vs abstract classes, single instance vs multiple instances, single superclass vs multiple superclasses... Some other examples are less known and more language dependent: named vs indexed instance variables, persistent vs non persistent, local vs remote...
This paper introduces a set of class properties in the context of Classtalk, a metaobject protocol for Smalltalk. It explicitly expresses these properties at the level of metaclasses, and gives a first taxonomy so as to better understand them. Then, it takes advantage of these explicit metaclasses to re-engineer some well-known Smalltalk class hierarchies. Such re-engineered examples give us the opportunity to raise the problem of metaclasses composition. They justify the use of explicit metaclasses to improve the design of class libraries.
Keywordsclass properties explicit metaclasses Smalltalk, Classtalk language design reuse software engineering CASE tools patterns
Unable to display preview. Download preview PDF.
- [BI82]Alan Borning and Daniel Ingalls. Multiple Inheritance in Smalltalk-80. In Proceedings of AAAI'82, pages 234–237, Pittsburgh, Pennsylvania, August 1982.Google Scholar
- [Coi93]Pierre Cointe. “Object-Oriented Programming: The CLOS Perspective” edited by Andreas Pæpcke, chapter CLOS and Smalltalk, pages 215–250. The MIT Press, Cambridge, Massachusetts, 1993.Google Scholar
- [DF94]Scott Danforth and Ira R. Forman. Reflections on Metaclass Programming in SOM. In Proceedings of OOPSLA '94, Portland, Oregon, October 1994.Google Scholar
- [GHJV94]Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Addison-Wesley, Reading, Massachusetts, 1994.Google Scholar
- [GR83]Adele Goldberg and Dave Robson. Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading, Massachusetts, 1983.Google Scholar
- [HL95]Walter L. Hürsch and Cristina Videira Lopes. Separation of Concerns. Technical Report NU-CCS-95-03, College of Computer Science, Northeastern University, Boston, MA, February 1995.Google Scholar
- [KdRB91]Gregor Kiczales, Jim des Rivières, and Daniel G. Bobrow. The Art of the Metaobject Protocol. Cambridge, MIT Press, 1991.Google Scholar
- [Riv96]Fred Rivard. Pour un lien d'instanciation dynamique dans les langages à classes. In Journées Francophones des Langages Applicatifs, JFLA '96. INRIA — collection didactique, January 1996.Google Scholar
- [RM93]F. Rousseau and J. Malenfant. Browsing in Explicit Metaclass Languages: an Essay in Reflective Programming Environments. In Informal Proceedings of the Third Workshop on Reflection and Metalevel Architectures in Object-Oriented Programming, OOPSLA'93, October 1993.Google Scholar
- [SKT96]Suzanne Skublics, Edward J. Klimas, and David A. Thomas. Smalltalk with Style. Prentice-Hall International, Englewood Cliffs, New Jersey, 1996.Google Scholar
- [SOM93]IBM. SOMobjects Developer Toolkit Users Guide release 2.0, second edition, June 1993.Google Scholar
- [WM80]Daniel Weinreb and David A. Moon. Flavors: Message Passing in the Lisp Machine. Technical Report A.I. Memo No. 602, MIT, Artificial Intelligence Laboratory, November 1980.Google Scholar