Revisiting Parametric Types and Virtual Classes | SpringerLink
Skip to main content

Revisiting Parametric Types and Virtual Classes

  • Conference paper
Objects, Models, Components, Patterns (TOOLS 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6141))

  • 512 Accesses

Abstract

This paper presents a conceptually oriented updated view on the relationship between parametric types and virtual classes. The traditional view is that parametric types excel at structurally oriented composition and decomposition, and virtual classes excel at specifying mutually recursive families of classes whose relationships are preserved in derived families. Conversely, while class families can be specified using a large number of F-bounded type parameters, this approach is complex and fragile; and it is difficult to use traditional virtual classes to specify object composition in a structural manner, because virtual classes are closely tied to nominal typing. This paper adds new insight about the dichotomy between these two approaches; it illustrates how virtual constraints and type refinements, as recently introduced in gbeta and Scala, enable structural treatment of virtual types; finally, it shows how a novel kind of dynamic type check can detect compatibility among entire families of classes.

This work was supported by FTP 274-06-0029.

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

Access this chapter

Subscribe and save

Springer+ Basic
¥17,985 /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
JPY 3498
Price includes VAT (Japan)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
JPY 5719
Price includes VAT (Japan)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
JPY 7149
Price includes VAT (Japan)
  • 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. Agesen, O., Freund, S.N., Mitchell, J.C.: Adding type parameterization to the Java language. In: Proceedings of OOPSLA ’97, pp. 49–65 (1997)

    Google Scholar 

  2. Altherr, P.: A typed intermediate language and algorithms for compiling scala by successive rewritings. PhD thesis, EPFL (2006), http://library.epfl.ch/theses/?nr=3509

  3. Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: An overview of CaesarJ. In: Rashid, A., Aksit, M. (eds.) Transactions on Aspect-Oriented Software Development I. LNCS, vol. 3880, pp. 135–173. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  4. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: adding genericity to the Java programming language. In: Proceedings of OOPSLA ’98, pp. 183–200 (1998)

    Google Scholar 

  5. Bruce, K.B., 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 

  6. Canning, P., Cook, W., Hill, W., Olthoff, W.: F-bounded polymorphism for object-oriented programming. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture ’89, pp. 273–280 (1989)

    Google Scholar 

  7. Ernst, E.: gbeta – a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, Aarhus University, Århus, Denmark (1999)

    Google Scholar 

  8. Ernst, E.: Propagating class and method combination. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 67–91. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

  11. Ernst, E.: Reconciling virtual classes with genericity. In: Lightfoot, D.E., Szyperski, C. (eds.) JMLC 2006. LNCS, vol. 4228, pp. 57–72. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  12. Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: Proceedings of POPL ’06, pp. 270–282 (2006)

    Google Scholar 

  13. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison-Wesley, Reading (May 2005)

    Google Scholar 

  14. Herrmann, S.: Object teams: Improving modularity for crosscutting collaborations. In: Proceedings of Net. Object days, pp. 248–264 (2002)

    Google Scholar 

  15. Herrmann, S., Herrmann, S., Hundt, C., Hundt, C., Mehner, K., Mehner, K.: Translation polymorphism in object teams. Technical report, Technical University Berlin (2004)

    Google Scholar 

  16. Kennedy, A., Syme, D.: Design and implementation of generics for the.net common language runtime. SIGPLAN Not. 36(5), 1–12 (2001)

    Article  Google Scholar 

  17. Madsen, O.L., Møller-Pedersen, B.: Virtual classes: A powerful mechanism in object-oriented programming. In: Proceedings of OOPSLA ’89, pp. 397–406 (1989)

    Google Scholar 

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

    Google Scholar 

  19. Mezini, M., Ostermann, K.: Conquering aspects with Caesar. In: Proceedings of AOSD ’03, pp. 90–99 (2003)

    Google Scholar 

  20. Moors, A., Piessens, F., Odersky, M.: Generics of a higher kind. In: Proceedings of OOPSLA ’08, pp. 423–438 (2008)

    Google Scholar 

  21. Myers, A.C., Bank, J.A., Liskov, B.: Parameterized types for Java. In: Proceedings of POPL ’97, pp. 132–145 (1997)

    Google Scholar 

  22. Nielsen, A.B., Ernst, E.: Optimizing dynamic class composition in a statically typed language. In: Paige, R.F., Meyer, B. (eds.) TOOLS EUROPE 2008. LNBIP, vol. 11, pp. 161–177. Springer, Heidelberg (1974)

    Google Scholar 

  23. Nystrom, N., Chong, S., Myers, A.C.: Scalable extensibility via nested inheritance. In: OOPSLA ’04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 99–115 (2004)

    Google Scholar 

  24. Nystrom, N., Qi, X., Myers, A.C.: J&: nested intersection for scalable software composition. In: Proceedings of OOPSLA ’06, pp. 21–36 (2006)

    Google Scholar 

  25. Nystrom, N., Saraswat, V., Palsberg, J., Grothoff, C.: Constrained types for object-oriented languages. In: Proceedings of OOPSLA ’08, pp. 457–474 (2008)

    Google Scholar 

  26. Odersky, M.: The Scala Language Specification. EPFL, Version 2.7 edn. (March 2009)

    Google Scholar 

  27. Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A nominal theory of objects with dependent types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 201–224. Springer, Heidelberg (2003)

    Google Scholar 

  28. Odersky, M., Wadler, P.: Pizza into Java: translating theory into practice. In: Proceedings of POPL ’97, pp. 146–159 (1997)

    Google Scholar 

  29. Odersky, M., Zenger, M.: Independently extensible solutions to the expression problem. In: Proc. FOOL 12 (January 2005)

    Google Scholar 

  30. Qi, X., Myers, A.C.: Sharing classes between families. In: Proceedings of PLDI ’09, pp. 281–292 (2009)

    Google Scholar 

  31. Russo, C.V.: First-class structures for Standard ML. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 336–350. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  32. Saito, C., Igarashi, A., Viroli, M.: Lightweight family polymorphism*. Journal of Functional Programming 18(3), 285–331 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  33. Ullman, J.D.: Elements of ML programming (ML97 ed.). Prentice-Hall, Inc, Upper Saddle River (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Madsen, A.B., Ernst, E. (2010). Revisiting Parametric Types and Virtual Classes. In: Vitek, J. (eds) Objects, Models, Components, Patterns. TOOLS 2010. Lecture Notes in Computer Science, vol 6141. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-13953-6_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-13953-6_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-13952-9

  • Online ISBN: 978-3-642-13953-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics