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.
This work was partly supported by MURST COFIN′99 TOSCA Project and CNR-GNSAGA.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
M. Abadi and L. Cardelli. A Theory of Objects. Springer, 1996.
K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language. Addison-Wesley, 3rd edition, 2000.
J. Bergin. Multiple Inheritance in Java. Paice University, available athttp://csis.pace.edu/~bergin.
L. Bettini and D. Cappetta. A Java 2 Network Class Loader. Dr. Dobb’s Journal of Software Tools, 26(2):58–64, Feb. 2001.
V. Bono, A. Patel, and V. Shmatikov. A Core Calculus of Classes and Mixins. In R. Guerraoui, editor, Proceedings ECOOP′99, number 1628 in LCNS, pages 43–66. Springer-Verlag, 1999.
N. Boyen, C. Lucas, and P. Steyaert. Generalised Mixin-based Inheritance to Support Multiple Inheritance. Technical Report vub-prog-tr-94-12, Vrije Universiteit Brussel, 1994.
G. Bracha and W. Cook. Mixin-Based Inheritance. ACM SIGPLAN Notices, 25(10):303–311, Oct. 1990. OOPSLA ECO OP’90 Proceedings, N. Meyrowitz (editor).
L. Cardelli. A Semantics of Multiple Inheritance. Information and Computation, 76(2/3):138–164, 1988.
L. Cardelli and P. Wegner. On Understanding Types, Data Abstraction, and Polymorphism. ACM Computing Surveys, 17(4):471–522, 1985.
C. Chambers, D. Ungar, B.-W. Chang, and U. Hölzle. Parents are Shared Parts of Objects: Inheritance and Encapsulation in Self. Lisp and Symbolic Computation, 4(3):207–222, 1991.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
A. Goldberg and D. Robson. Smalltalk 80: The Language. Addison-Wesley, 1989.
J. Gosling and H. McGilton. The Java Language Environment (A White Paper), 1995. Sun Microsystems, available on line.
W. Harrison, H. Ossher, and P. Tarr. Using Delegation for Software and Subject Composition. Technical Report RC 20946, IBM Thomas J. Watson Research Center, 1997.
M. Lutz. Programming Python. O’Reilly & Associates, 1996.
B. Meyer. Object-Oriented Software Construction. Prentice Hall, 2nd edition, 2000.
A. Oursland. Multiple Inheritance in Java. DevJournal, on line http://journal.iftech.com.
J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen. Object-Oriented Modeling and Design. Prentice Hall, 1991.
M. Sakkinen. Inheritance and Other Main Principles of C++ and Other Object Oriented Languages. PhD thesis, University of Jyvaskyla, 1992.
G. Singh. Single versus Multiple Inheritance in Object Oriented Programming. OOPS Messenger, 6(1), 1995.
G. Steele. Common Lisp: The Language. Digital Press, 2nd edition, 1990.
B. Stroustrup. The Design and Evolution of C++. Addison-Wesley, 1994.
B. Stroustrup. The Programming Language. Addison-Wesley, 3rd edition, 1997.
E. Tempero and R. Biddle. Simulating Multiple Inheritance in Java. Journal of Information and Software Technology, (55):87–100, 2000.
K. Thirunarayan, G. Kniesel, and H. Hampapuram. Simulating Multiple Inheritance and Generics in Java. Computer Languages, 2001. Elsevier Science. To appear.
J. Viega, B. Tutt, and R. Behrends. Automated Delegation is a Viable Alternative to Multiple Inheritance in Class Based Languages. Technical Report CS-98-03, UVa Computer Science, 1998.
P. Wegner. Concepts and Paradigms of Object-Oriented Programming. OOPS Messenger, 1(1):7–87, 1990. Expansion of Oct 4 OOPSLA ′89 Keynote Talk.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer Science+Business Media New York
About this chapter
Cite this chapter
Bettini, L., Loreti, M., Venneri, B. (2003). On Multiple Inheritance in Java. In: D’Hondt, T. (eds) Technology of Object-Oriented Languages, Systems and Architectures. The Kluwer International Series in Engineering and Computer Science, vol 732. Springer, Boston, MA. https://doi.org/10.1007/978-1-4615-0413-9_1
Download citation
DOI: https://doi.org/10.1007/978-1-4615-0413-9_1
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4613-5064-4
Online ISBN: 978-1-4615-0413-9
eBook Packages: Springer Book Archive