Skip to main content

Family Polymorphism

  • Conference paper
  • First Online:
ECOOP 2001 — Object-Oriented Programming (ECOOP 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2072))

Included in the following conference series:

Abstract

This paper takes polymorphism to the multi-object level. Traditional inheritance, polymorphism, and late binding interact nicely to provide both flexibility and safety — when a method is invoked on an object via a polymorphic reference, late binding ensures that we get the appropriate implementation of that method for the actual object. We are granted the flexibility of using different kinds of objects and different method implementations, and we are guaranteed the safety of the combination. Nested classes, polymorphism, and late binding of nested classes interact similarly to provide both safety and flexibility at the level of multi-object systems. We are granted the flexibility of using different families of kinds of objects, and we are guaranteed the safety of the combination. This paper highlights the inability of traditional polymorphism to handle multiple objects, and presents family polymorphism as a way to overcome this problem. Family polymorphism has been implemented in the programming language gbeta, a generalized version of Beta, and the source code of this implementation is available under GPL.1

http://www.cs.auc.dk/~eernst/gbeta/.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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.

Similar content being viewed by others

References

  1. M. Aksit, K. Wakita, J. Bosch, and L. Bergmans. Abstracting object interactions using composition filters. Lecture Notes in Computer Science, 791:152++, 1994. 325

    Google Scholar 

  2. Ken Arnold and James Gosling. The Java™ Programming Language. The Java™ Series. Addison-Wesley, Reading, MA, USA, 1998.

    Google Scholar 

  3. L. Augustsson. Cayenne–a language with dependent types. In Proceedings of the 3rd ACM SIGPLAN International Conference on Functional Programming, pages 239–250, 1998.

    Google Scholar 

  4. Don Batory, Rich Cardone, and Yannis Smaragdakis. Object-oriented frameworks and product lines. In P. Donohoe, editor, Proceedings of the First Software Product Line Conference, pages 227–247, August 2000.

    Google Scholar 

  5. B. Bobrow, D. DeMichiel, R. Gabriel, S. Keene, G. Kiczales, and D. Moon. Common Lisp Object System Specification. Document 88-002R. X3J13, June 1988.

    Google Scholar 

  6. Gilad Bracha, Martin Odersky, David Stoutamire, and Philip Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In Craig Chambers, editor, Proceedings OOPSLA’98, ACM SIGPLAN Notices, volume 33, 10, pages 183–200, Vancouver, BC, October 1998.

    Google Scholar 

  7. K. Bruce, M. Odersky, and P. Wadler. A statically safe alternative to virtual types. Lecture Notes in Computer Science, 1445:523–549, 1998.

    Google Scholar 

  8. Peter Canning, William Cook, Walter Hill, John Mitchell, and Walter Olthoff. F-bounded polymorphism for object-oriented programming. In Fourth International Conference on Functional Programming and Computer Architecture. ACM, September 1989. Also technical report STL-89-5, from Software Technology Laboratory, Hewlett-Packard Laboratories.

    Google Scholar 

  9. Robert Cartwright. Compatible genericity with run-time types for the Javatm programming language. In Craig Chambers, editor, Proceedings OOPSLA’98, ACM SIGPLAN Notices, volume 33, 10, Vancouver, October 1998. ACM Press.

    Google Scholar 

  10. Craig Chambers. Object-oriented multi-methods in Cecil. In O. LehrmannMadsen, editor, Proceedings ECOOP’92, LNCS 615, pages 33–56, Utrecht, The Netherlands, June 1992. Springer-Verlag.

    Google Scholar 

  11. Craig Chambers. The Cecil Language, Specification and Rationale. Dept. of Comp.Sci. and Eng., Univ. of Washington, Seattle, Washington, 1997.

    Google Scholar 

  12. Krzysztof Czarnecki and Ulrich Eisenecker. Generative Programming: Methods, Tools, and Applications. Addison-Wesley, 1st edition, 2000.

    Google Scholar 

  13. Erik Ernst. gbeta–A Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Devise, Department of Computer Science, University of Aarhus, Aarhus, Denmark, June 1999.

    Google Scholar 

  14. Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-oriented programming. In Mehmet Aksit and Satoshi Matsuoka, editors, Proceedings ECOOP’97, LNCS 1241, pages 220–242, Jyväskylä, Finland, 9–13 June 1997. Springer.

    Google Scholar 

  15. Vassily Litvinov. Constraint-based polymorphism in Cecil: Towards a practical and static type system. In Craig Chambers, editor, Proceedings OOPSLA’98, ACM SIGPLAN Notices, volume 33, 10, Vancouver, October 1998. ACM Press.

    Google Scholar 

  16. D. MacQueen. Modules for standard ML. In Proceedings of the 1984 ACM Symposium on Lisp and Functional Programming, pages 198–207, New York, August 1984. ACM Press.

    Google Scholar 

  17. Ole Lehrmann Madsen. Semantic analysis of virtual classes and nested classes. In Linda M. Northrop, editor, Proceedings OOPSLA’99, ACM SIGPLAN Notices, volume 34, 10, Denver, October 1999. ACM Press.

    Google Scholar 

  18. Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings OOPSLA’89, ACM SIGPLAN Notices, volume 24, 10, pages 397–406, October 1989.

    Article  Google Scholar 

  19. Ole Lehrmann Madsen, Birger Møller-Pedersen, and Kristen Nygaard. Object-Oriented Programming in the BETA Programming Language. Addison-Wesley, Reading, MA, USA, 1993.

    Google Scholar 

  20. R. Milner, M. Tofte, R. W. Harper, and D. MacQueen. The Definition of Standard ML. MIT Press, 1997.

    Google Scholar 

  21. Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Conference Record of POPL’ 97: The 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 146–159, Paris, France, 15-17 January 1997.

    Google Scholar 

  22. Didier Rémy and Jérôme Vouillon. On the (un)reality of virtual types. Work in progress, available from http://pauillac.inria.fr/~remy/, 2001.

  23. Andrew Shalit. The Dylan Reference Manual: The Definitive Guide to the New Object-Oriented Dynamic Language. Addison-Wesley, Reading, Mass., 1997.

    Google Scholar 

  24. Jose H. Solorzano and Suad Alagić. Parametric polymorphism for Javatm: A. In Craig Chambers, editor, Proceedings OOPSLA’98, ACM SIGPLAN Notices, volume 33, 10, Vancouver, October 1998. ACM Press.

    Google Scholar 

  25. Bjarne Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997.

    Google Scholar 

  26. Peri Tarr, Harold Ossher, William Harrison, and Stanley M. Sutton. N degrees of separation: Multi-dimensional separation of concerns. In Proceedings of the 1999 International Conference on Software Engineering (ICSE’99), pages 107–119, Los Angeles, May 1999. Association for Computing Machinery.

    Google Scholar 

  27. Kresten Krab Thorup. Genericity in Java with virtual types. In Proceedings ECOOP’97, LNCS 1241, pages 444–471, Jyväskylä, June 1997. Springer-Verlag.

    Google Scholar 

  28. Mads Torgersen. Virtual types are statically safe. In 5th Workshop on Foundations of Object-Oriented Languages (FOOL), at http://pauillac.inria.fr/~remy/fool/program.html, January 1998.

  29. Mjølner Informatics, Århus, Denmark: http://www.mjolner.dk/.

  30. Pierre Weis, María-Virginia Aponte, Alain Laville, Michel Mauny, and Ascánder Suárez. The CAML reference manual, Version 2.6. Technical report, Projet Formel, INRIA-ENS, 1989.

    Google Scholar 

  31. Hongwei Xi. Dependent Types in Practical Programming. PhD thesis, Department of Mathematical Sciences, Carnegie Mellon University, Pittsburgh, PA 15213, September 1998.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ernst, E. (2001). Family Polymorphism. In: Knudsen, J.L. (eds) ECOOP 2001 — Object-Oriented Programming. ECOOP 2001. Lecture Notes in Computer Science, vol 2072. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45337-7_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-45337-7_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42206-8

  • Online ISBN: 978-3-540-45337-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics