Abstract
Type abstraction in object-oriented languages mainly embodies two techniques with different strenghts and weaknesses. The first technique is extension, yielding abstraction mechanisms with good support for gradual specification; the prime example is inheritance. The second technique is functional abstraction, yielding more precise knowledge about the outcome; the prime example is type parameterized classes. This paper argues that they should be clearly separated to work optimally. We have applied this design philosophy to a language based on an extension mechanism, namely virtual classes. As a result, a kind of type parameters have been introduced, but they are simple and only used where they excel. Conversely, final definitions of virtual classes have been removed from the language, thus making virtual classes more flexible. The resulting language presents a clearer and more flexible trade-off between extensibility and predictability, empowering programmers to choose the right balance.
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
Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings OOPSLA/ECOOP, ACM SIGPLAN Notices, vol. 25(10), pp. 303–311 (October 1990)
Bruce, K., Odersky, M., Wadler, P.: A statically safe alternative to virtual types. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 523–549. Springer, Heidelberg (1998)
Bruce, K.B., Van Gent, R., Schuett, A.: PolyTOIL: A type-safe polymorphic object-oriented language. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 27–51. Springer, Heidelberg (1995)
Canning, P., Cook, W., Hill, W., Mitchell, J., Olthoff, W.: F-bounded polymorphism for object-oriented programming. In: Fourth International Conference on Functional Programming and Computer Architecture. ACM, New York (1989); Also technical report STL-89-5, from Software Technology Laboratory, Hewlett-Packard Laboratories (1989)
Ernst, E.: gbeta – A Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. Ph.D thesis, DEVISE, Department of Computer Science, University of Aarhus, Aarhus, Denmark (June 1999)
Ernst, E.: Family polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001)
Ernst, E.: Higher-order hierarchies. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 303–329. Springer, Heidelberg (2003)
Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: Proceedings POPL 2006, Charleston, SC, USA, pp. 270–282. ACM, New York (2006)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Conference Record of POPL 1998: The 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, California, January 19-21, pp. 171–183 (1998)
Girard, J.-Y.: Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur. Ph.D thesis, Université Paris VII (1972); A summary appeared in: Fenstad, J.E.(ed.) Proceedings of the Second Scandinavian Logic Symposium ( editor), pp. 63–92. North-Holland (1971)
Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. The Java Series. Addison-Wesley, Reading (2004)
Igarashi, A., Viroli, M.: On Variance-Based Subtyping for Parametric Types. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 441–469. Springer, Heidelberg (2002)
Madsen, O.L., Møller-Pedersen, B.: Virtual classes: A powerful mechanism in object-oriented programming. In: Proceedings OOPSLA (1989); ACM SIGPLAN Notices.  vol. 24(10), pp. 397–406 (October 1989)
Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the BETA Programming Language. Addison Wesley, Reading (1993)
Mezini, M., Ostermann, K.: Conquering aspects with Caesar. In: Proceedings AOSD 2003, Boston, USA, pp. 90–99 (2003)
Microsoft Corporation, Seattle, USA. C# – Version 2.0 Specification (May 2004)
Milner, R., Tofte, M., Harper, R.W., MacQueen, D.: The Definition of Standard ML. MIT Press, Cambridge (1997)
Nystrom, N., Chong, S., Myers, A.C.: Scalable extensibility via nested inheritance. In: Proceedings OOPSLA 2004, pp. 99–115. ACM Press, New York (2004)
Odersky, M., et al.: An overview of the scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland (2004)
Odersky, M., Zenger, M.: Scalable component abstractions. In: Proceedings OOPSLA 2005, pp. 41–57. ACM Press, New York (2005)
Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 89–110. Springer, Heidelberg (2002)
Strachey, C.: Fundamental concepts in programming languages. Lecture Notes, International Summer School in Programming Languages, Copenhagen, Denmark (1967)
Thorup, K.K., Torgersen, M.: Unifying genericity - combining the benefits of virtual types and parameterized classes. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 186–204. Springer, Heidelberg (1999)
Torgersen, M.: The expression problem revisited – four new solutions using generics. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 123–146. Springer, Heidelberg (2004)
Torgersen, M., Ernst, E., Hansen, C.P., von der Ahé, P., Bracha, G., Gafter, N.: Adding wildcards to the java programming language. Journal of Object Technology 3(11) (2004), http://www.jot.fm/issues/issue_2004_12/article5
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ernst, E. (2006). Reconciling Virtual Classes with Genericity. In: Lightfoot, D.E., Szyperski, C. (eds) Modular Programming Languages. JMLC 2006. Lecture Notes in Computer Science, vol 4228. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11860990_5
Download citation
DOI: https://doi.org/10.1007/11860990_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40927-4
Online ISBN: 978-3-540-40928-1
eBook Packages: Computer ScienceComputer Science (R0)