ScienceDirect® Home Skip Main Navigation Links
You have guest access to ScienceDirect. Find out more.
 
Home
Browse
My Settings
Alerts
Help
 Quick Search
 Search tips (Opens new window)
    Clear all fields    
Computer Languages, Systems & Structures
Volume 31, Issues 3-4, October-December 2005, Pages 143-164
Smalltalk
 
Font Size: Decrease Font Size  Increase Font Size
 Abstract - selected
Article
Purchase PDF (275 K)

 
 
 
Related Articles in ScienceDirect
View More Related Articles
 
View Record in Scopus
 
doi:10.1016/j.cl.2004.11.003    How to Cite or Link Using DOI (Opens New Window)
Copyright © 2005 Elsevier Ltd All rights reserved.

Uniform and safe metaclass compositionstar, open

Stéphane Ducassea, Corresponding Author Contact Information, E-mail The Corresponding Author, Nathanael Schärlia and Roel Wuytsb

aSoftware Composition Group, IAM-Universität Bern, Neubruckstr. 10, 2012 Bern, CH, Switzerland bDecomp Laboratory, Université Libre de Bruxelles, Belgium

Accepted 2 November 2004. 
Available online 7 March 2005.

Purchase the full-text article



References and further reading may be available for this article. To view references and further reading you must purchase this article.

Abstract

In pure object-oriented languages, classes are objects, instances of other classes called metaclasses. In the same way as classes define the properties of their instances, metaclasses define the properties of classes. It is therefore very natural to wish to reuse class properties, utilizing them amongst several classes. However this introduced metaclass composition problems, i.e., code fragments applied to one class may break when used on another class due to the inheritance relationship between their respective metaclasses.

Numerous approaches have tried to solve metaclass composition problems, but they always resort to an ad-hoc manner of handling conflicting properties, alienating the meta-programmer. We propose a uniform approach that represents class properties as traits, groups of methods that act as a unit of reuse from which classes are composed. Like all the other classes in the system, metaclasses are composed out of traits. This solution supports the reuse of class properties, and their safe and automatic composition based on explicit conflict resolution. The paper discusses traits and our solution, shows concrete examples implemented in the Smalltalk environment Squeak, and compares our approach with existing models for composing class properties.

Keywords: Metaclass composition; Traits; Reflective kernel; Reuse; Mixins

Article Outline

1. Reusing class properties
2. Explicit metaclass problems
3. Qualifying composition
4. Traits in a Nutshell
5. Using traits to reuse and compose class properties
5.1. Singleton
5.2. The Boolean hierarchy
6. Engineering the meta level
6.1. Class properties
6.2. Advantages for the programmer
7. A new kernel
8. Related work
8.1. Metaclass composition
8.1.1. Smalltalk
8.1.2. CLOS
8.1.3. SOM
8.1.4. NeoClasstalk
8.1.5. Dynamic class creation and dynamic change of class
8.1.6. Ad-hoc and implicit composition
8.1.7. MetaclassTalk
8.2. Metaobjects
9. Advantages and disadvantages
10. Class properties
11. Automatic composition
12. Conclusion and future work
Acknowledgements
References












Computer Languages, Systems & Structures
Volume 31, Issues 3-4, October-December 2005, Pages 143-164
Smalltalk
 
Home
Browse
My Settings
Alerts
Help
Elsevier.com (Opens new window)
About ScienceDirect  |  Contact Us  |  Information for Advertisers  |  Terms & Conditions  |  Privacy Policy
Copyright © 2008 Elsevier B.V. All rights reserved. ScienceDirect® is a registered trademark of Elsevier B.V.