Skip to main content

Reconciling Virtual Classes with Genericity

  • Conference paper
Modular Programming Languages (JMLC 2006)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4228))

Included in the following conference series:

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.

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

References

  1. Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings OOPSLA/ECOOP, ACM SIGPLAN Notices, vol. 25(10), pp. 303–311 (October 1990)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  6. Ernst, E.: Family polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  7. Ernst, E.: Higher-order hierarchies. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 303–329. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  11. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. The Java Series. Addison-Wesley, Reading (2004)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

  14. Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the BETA Programming Language. Addison Wesley, Reading (1993)

    Google Scholar 

  15. Mezini, M., Ostermann, K.: Conquering aspects with Caesar. In: Proceedings AOSD 2003, Boston, USA, pp. 90–99 (2003)

    Google Scholar 

  16. Microsoft Corporation, Seattle, USA. C# – Version 2.0 Specification (May 2004)

    Google Scholar 

  17. Milner, R., Tofte, M., Harper, R.W., MacQueen, D.: The Definition of Standard ML. MIT Press, Cambridge (1997)

    Google Scholar 

  18. Nystrom, N., Chong, S., Myers, A.C.: Scalable extensibility via nested inheritance. In: Proceedings OOPSLA 2004, pp. 99–115. ACM Press, New York (2004)

    Chapter  Google Scholar 

  19. Odersky, M., et al.: An overview of the scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland (2004)

    Google Scholar 

  20. Odersky, M., Zenger, M.: Scalable component abstractions. In: Proceedings OOPSLA 2005, pp. 41–57. ACM Press, New York (2005)

    Chapter  Google Scholar 

  21. Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 89–110. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  22. Strachey, C.: Fundamental concepts in programming languages. Lecture Notes, International Summer School in Programming Languages, Copenhagen, Denmark (1967)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

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

Publish with us

Policies and ethics