Safe metaclass programming

  • Authors:
  • Noury M. N. Bouraqadi-Saâdani;Thomas Ledoux;Fred Rivard

  • Affiliations:
  • École des Mines de Nantes, BP 20722, 44307 Nantes - FRANCE;École des Mines de Nantes, BP 20722, 44307 Nantes - FRANCE;École des Mines & OTI Inc. Nantes, BP 20722, 44307 Nantes - FRANCE and Object Technology International Inc. 2670 Queensview Drive, Ottawa, Ontario, CANADA K2B 8K1

  • Venue:
  • Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

In a system where classes are treated as first class objects, classes are defined as instances of other classes called metaclasses. An important benefit of using metaclasses is the ability to assign properties to classes (e.g. being abstract, being final, tracing particular messages, supporting multiple inheritance), independently from the base-level code. However, when both inheritance and instantiation are explicitly and simultaneously involved, communication between classes and their instances raises the metaclass compatibility issue. Some languages (such as SMALLTALK) address this issue but do not easily allow the assignment of specific properties to classes. In contrast, other languages (such as CLOS) allow the assignment of specific properties to classes but do not tackle the compatibility issue well.In this paper, we describe a new model of metalevel organization, called the compatibility model, which overcomes this difficulty. It allows safe metaclass programming since it makes it possible to assign specific properties to classes while ensuring metaclass compatibility. Therefore, we can take advantage of the expressive power of metaclasses to build reliable software. We extend this compatibility model in order to enable safe reuse and composition of class specific properties. This extension is implemented in NEOCLASSTALK, a fully reflective SMALLTALK.