The presence of Multiple Inheritance in a language raises subtle problems related to possible ambiguities. To avoid handling these difficulties, many languages, including Java, do not support multiple inheritance. This paper studies the problem of implementing multiple inheritance in a class-based language that does not provide it. In particular we propose an experimental extension of Java, M-Java, which enables multiple inheritance, and a precompilation process translating M-Java programs into standard Java programs. This translation process is automatic and transparent to the programmer. The distinguishing feature of our proposal is that crucial semantic aspects of multiple inheritance, related to overriding and subtyping, are preserved by the translation process. We show that such aspects are not preserved in other alternative solutions, presented in the literature, which rely on simulating multiple inheritance by delegation techniques. We will also show that, due to language features, some problems still arise concerning protected methods.

On Multiple Inheritance in Java.

Michele LORETI;
2003-01-01

Abstract

The presence of Multiple Inheritance in a language raises subtle problems related to possible ambiguities. To avoid handling these difficulties, many languages, including Java, do not support multiple inheritance. This paper studies the problem of implementing multiple inheritance in a class-based language that does not provide it. In particular we propose an experimental extension of Java, M-Java, which enables multiple inheritance, and a precompilation process translating M-Java programs into standard Java programs. This translation process is automatic and transparent to the programmer. The distinguishing feature of our proposal is that crucial semantic aspects of multiple inheritance, related to overriding and subtyping, are preserved by the translation process. We show that such aspects are not preserved in other alternative solutions, presented in the literature, which rely on simulating multiple inheritance by delegation techniques. We will also show that, due to language features, some problems still arise concerning protected methods.
2003
140207428X
268
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11581/405018
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? 1
social impact