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
- Type System
- Class Family
- Type Check
- Virtual Attribute
- Late Binding
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, access via your institution.
Tax calculation will be finalised at checkout
Purchases are for personal use onlyLearn about institutional subscriptions
Unable to display preview. Download preview PDF.
M. Aksit, K. Wakita, J. Bosch, and L. Bergmans. Abstracting object interactions using composition filters. Lecture Notes in Computer Science, 791:152++, 1994. 325
Ken Arnold and James Gosling. The Java™ Programming Language. The Java™ Series. Addison-Wesley, Reading, MA, USA, 1998.
L. Augustsson. Cayenne–a language with dependent types. In Proceedings of the 3rd ACM SIGPLAN International Conference on Functional Programming, pages 239–250, 1998.
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.
B. Bobrow, D. DeMichiel, R. Gabriel, S. Keene, G. Kiczales, and D. Moon. Common Lisp Object System Specification. Document 88-002R. X3J13, June 1988.
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.
K. Bruce, M. Odersky, and P. Wadler. A statically safe alternative to virtual types. Lecture Notes in Computer Science, 1445:523–549, 1998.
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.
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.
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.
Craig Chambers. The Cecil Language, Specification and Rationale. Dept. of Comp.Sci. and Eng., Univ. of Washington, Seattle, Washington, 1997.
Krzysztof Czarnecki and Ulrich Eisenecker. Generative Programming: Methods, Tools, and Applications. Addison-Wesley, 1st edition, 2000.
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.
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.
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.
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.
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.
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.
Ole Lehrmann Madsen, Birger Møller-Pedersen, and Kristen Nygaard. Object-Oriented Programming in the BETA Programming Language. Addison-Wesley, Reading, MA, USA, 1993.
R. Milner, M. Tofte, R. W. Harper, and D. MacQueen. The Definition of Standard ML. MIT Press, 1997.
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.
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.
Andrew Shalit. The Dylan Reference Manual: The Definitive Guide to the New Object-Oriented Dynamic Language. Addison-Wesley, Reading, Mass., 1997.
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.
Bjarne Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 1997.
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.
Kresten Krab Thorup. Genericity in Java with virtual types. In Proceedings ECOOP’97, LNCS 1241, pages 444–471, Jyväskylä, June 1997. Springer-Verlag.
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.
Mjølner Informatics, Århus, Denmark: http://www.mjolner.dk/.
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.
Hongwei Xi. Dependent Types in Practical Programming. PhD thesis, Department of Mathematical Sciences, Carnegie Mellon University, Pittsburgh, PA 15213, September 1998.
Editors and Affiliations
© 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
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42206-8
Online ISBN: 978-3-540-45337-6
eBook Packages: Springer Book Archive