Skip to main content

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. M. Abadi and L. Cardelli. A Theory of Objects. Springer, 1996.

    Google Scholar 

  2. K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language. Addison-Wesley, 3rd edition, 2000.

    Google Scholar 

  3. J. Bergin. Multiple Inheritance in Java. Paice University, available athttp://csis.pace.edu/~bergin.

  4. L. Bettini and D. Cappetta. A Java 2 Network Class Loader. Dr. Dobb’s Journal of Software Tools, 26(2):58–64, Feb. 2001.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. 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.

    Google Scholar 

  7. 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).

    Article  Google Scholar 

  8. L. Cardelli. A Semantics of Multiple Inheritance. Information and Computation, 76(2/3):138–164, 1988.

    Article  MathSciNet  MATH  Google Scholar 

  9. L. Cardelli and P. Wegner. On Understanding Types, Data Abstraction, and Polymorphism. ACM Computing Surveys, 17(4):471–522, 1985.

    Article  Google Scholar 

  10. 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.

    Article  Google Scholar 

  11. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.

    Google Scholar 

  12. A. Goldberg and D. Robson. Smalltalk 80: The Language. Addison-Wesley, 1989.

    Google Scholar 

  13. J. Gosling and H. McGilton. The Java Language Environment (A White Paper), 1995. Sun Microsystems, available on line.

    Google Scholar 

  14. 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.

    Google Scholar 

  15. M. Lutz. Programming Python. O’Reilly & Associates, 1996.

    Google Scholar 

  16. B. Meyer. Object-Oriented Software Construction. Prentice Hall, 2nd edition, 2000.

    Google Scholar 

  17. A. Oursland. Multiple Inheritance in Java. DevJournal, on line http://journal.iftech.com.

  18. J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen. Object-Oriented Modeling and Design. Prentice Hall, 1991.

    Google Scholar 

  19. M. Sakkinen. Inheritance and Other Main Principles of C++ and Other Object Oriented Languages. PhD thesis, University of Jyvaskyla, 1992.

    Google Scholar 

  20. G. Singh. Single versus Multiple Inheritance in Object Oriented Programming. OOPS Messenger, 6(1), 1995.

    Google Scholar 

    Google Scholar 

  21. G. Steele. Common Lisp: The Language. Digital Press, 2nd edition, 1990.

    Google Scholar 

  22. B. Stroustrup. The Design and Evolution of C++. Addison-Wesley, 1994.

    Google Scholar 

  23. B. Stroustrup. The Programming Language. Addison-Wesley, 3rd edition, 1997.

    Google Scholar 

  24. E. Tempero and R. Biddle. Simulating Multiple Inheritance in Java. Journal of Information and Software Technology, (55):87–100, 2000.

    Google Scholar 

  25. K. Thirunarayan, G. Kniesel, and H. Hampapuram. Simulating Multiple Inheritance and Generics in Java. Computer Languages, 2001. Elsevier Science. To appear.

    Google Scholar 

  26. 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.

    Google Scholar 

  27. P. Wegner. Concepts and Paradigms of Object-Oriented Programming. OOPS Messenger, 1(1):7–87, 1990. Expansion of Oct 4 OOPSLA ′89 Keynote Talk.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics