Loading…
Metamodeling semantics of multiple inheritance
Inheritance provides object-oriented programming with much of its great reusability power. When inheritance is single, its specifications are simple and everybody roughly agrees on them. In contrast, multiple inheritance yields ambiguities that have prompted long-standing debates, and no two languag...
Saved in:
Published in: | Science of computer programming 2011-07, Vol.76 (7), p.555-586 |
---|---|
Main Authors: | , |
Format: | Article |
Language: | English |
Subjects: | |
Citations: | Items that this one cites Items that cite this one |
Online Access: | Get full text |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Summary: | Inheritance provides object-oriented programming with much of its great reusability power. When inheritance is
single, its specifications are simple and everybody roughly agrees on them. In contrast,
multiple inheritance yields ambiguities that have prompted long-standing debates, and no two languages agree on its specifications. In this paper, we present a semantics of multiple inheritance based on metamodeling. A metamodel is proposed which distinguishes the “identity” of properties from their “values” or “implementations”. It yields a clear separation between syntactic and semantic conflicts. The former can be solved in any language at the expense of a common syntactic construct, namely full name qualification. However, semantic conflicts require a programmer’s decision, and the programming language must help the programmer to some extent. This paper surveys the approach based on
linearizations, which has been studied in depth, and proposes some extensions. As it turns out that only static typing takes full advantage of the metamodel, the interaction between multiple inheritance and static typing is also considered, especially in the context of virtual types. The solutions proposed by the various languages with multiple inheritance are compared with the metamodel results. Throughout the paper, difficulties encountered under the
open-world assumption are stressed.
► An object metamodel is formalized that provides a semantics of multiple inheritance. ► This metamodel distinguishes between syntactic and semantic conflicts. ► Fully qualified names answer syntactic conflicts. ► Linearizations answer semantic conflicts and provide method combination. ► Existing languages do not match exactly with the proposed semantics. |
---|---|
ISSN: | 0167-6423 1872-7964 |
DOI: | 10.1016/j.scico.2010.10.006 |