Modules and Class Refinement: A Meta-modeling Approach to Object-Oriented Programming
Résumé
With object-oriented programming, classes and inheritance have sometimes been considered as a definitive answer to the need for modularity and reusability in programming languages. However, this view of object-oriented languages is often considered as too limited and many authors have claimed that classes do not make appropriate modules. On the one hand, separate concerns are generally distributed on a set of closely related classes, while on the other, a class implements several unrelated concerns. The so-called expression problem stresses this limitation of the traditional view on object-oriented programming, which makes it easy to add new classes but quite impossible to add concerns to previously defined classes. Accordingly, recent research has yielded a lot of proposals addressing these commonly agreed needs. These proposals are based on various notions, e.g. virtual classes, higher-order hierarchies, nested inheritance, mixin layers or classboxes. All of these proposals are very similar and significantly different, so comparing and evaluating them is not easy, and selecting or designing the ‘best' one is a challenge. Moreover, an entire research field has emerged, i.e. aspect-oriented programming, dedicated to separation of crosscutting concerns. In this paper, we propose two coupled notions of modules and class refinement which provide the required modularity and reusability and represent a pretty good response to the expression problem. However, the goal of this paper is not only to propose these new notions—they are actually close to previous propositions, though somewhat different—but also to base this proposal on very simple and intuitive notions that already underlie object-oriented languages. Meta-modeling is the key of our approach and we use it as a sound criterion to select a precise specification among a large state space. We first propose a meta-model of classes and properties (i.e. methods and attributes), which provides clear insight into inheritance, especially when multiple. The point is that modules and module dependence are specified by a second meta-model which is isomorphic to the first one. Finally, this proposal is not only based on conceptual and theoretical considerations. Modules and class refinement are distinctive features of a new object-oriented language, Prm, and they are intensively used in the organization of its libraries and tools.
Mots clés
Language constructs and features— classes and objects
inheritance
modules and packages aspects
classes
crosscutting concerns
expression problem
hierarchies
import
linearization
meta-modeling
mixins
modules
multiple inheritance
overloading
redefinition
refinement
static typing
Object-oriented programming
Design tools and techniques—modules and interfaces
Software Architectures—information hiding
Reusable Software—reusable models
reusable libraries
C++
Java
Eiffel
Smalltalk
Clos
Prm
Domaines
Langage de programmation [cs.PL]
Loading...