skip to main content
10.1145/1111037.1111062acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

A virtual class calculus

Published:11 January 2006Publication History

ABSTRACT

Virtual classes are class-valued attributes of objects. Like virtual methods, virtual classes are defined in an object's class and may be redefined within subclasses. They resemble inner classes, which are also defined within a class, but virtual classes are accessed through object instances, not as static components of a class. When used as types, virtual classes depend upon object identity -- each object instance introduces a new family of virtual class types. Virtual classes support large-scale program composition techniques, including higher-order hierarchies and family polymorphism. The original definition of virtual classes in BETA left open the question of static type safety, since some type errors were not caught until runtime. Later the languages Caesar and gbeta have used a more strict static analysis in order to ensure static type safety. However, the existence of a sound, statically typed model for virtual classes has been a long-standing open question. This paper presents a virtual class calculus, VC, that captures the essence of virtual classes in these full-fledged programming languages. The key contributions of the paper are a formalization of the dynamic and static semantics of VC and a proof of the soundness of VC.

References

  1. K. Barrett, B. Cassels, P. Haahr, D. Moon, K. Playford, and P. T. Withington. A monotonic superclass linearization for Dylan. In Proceedings OOPSLA '96, pages 69--82. ACM Press, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Batory, V. Singhal, J. Thomas, S. Dasari, B. Geraci, and M. Sirkin. The genvoca model of software-system generators. IEEE Software, 11(5), 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Bracha and W. Cook. Mixin-based inheritance. In Proceedings OOPSLA/ECOOP'90. ACM SIGPLAN Notices 25(10), pages 303--311. ACM, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. K. B. Bruce, M. Odersky, and P. Wadler. A statically safe alternative to virtual types. In Proceedings ECOOP '98. LNCS 1445, pages 523--549. Springer, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. W. Cook. Object-oriented programming versus abstract data types. In Proc. of the REX Workshop/School on the Foundations of Object-Oriented Languages, LNCS 173. Springer-Verlag, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Drossopoulou, F. Damiani, M. Dezani-Ciancaglini, and P. Giannini. More dynamic object re-classification: FickleII. ACM Transactions On Programming Languages and Systems, 24(2):153--191, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. Ernst. Propagating class and method combination. In Proceedings ECOOP'99, LNCS 1628, pages 67--91, Lisboa, Portugal, June 1999. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. Ernst. Family polymorphism. In Proceedings ECOOP '01, LNCS 2072, pages 303--326. Springer, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E. Ernst. Higher-order hierarchies. In Proceedings ECOOP '03, LNCS. Springer, 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  10. E. Ernst, K. Ostermann, and W. Cook. A virtual class calculus. Technical report, University of Aarhus, Aarhus, Denmark, 2005.]]Google ScholarGoogle Scholar
  11. K. Fisher and J. Reppy. Statically typed traits. Technical Report TR-2003-13, University of Chicago, Chicago, USA, 2003.]]Google ScholarGoogle Scholar
  12. M. Flatt, S. Krishnamurthi, and M. Felleisen. A programmer's reduction semantics for classes and mixins. In Formal Syntax and Semantics of Java, pages 241--269, London, UK, 1999. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison Wesley, 1995.]]Google ScholarGoogle Scholar
  14. C. A. Gunter. Semantics of Programming Languages: Structures and Techniques. Foundations of Computing. MIT Press, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Harrejon, D. Batory, and W. R. Cook. Evaluating support for features in advanced modularization technologies. In Proceedings ECOOP '05. Springer, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Igarashi and B. Pierce. Foundations for virtual types. Information and Computation, 175(1):34--49, 2002.]]Google ScholarGoogle ScholarCross RefCross Ref
  17. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst., 23(3):396--450, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Igarashi and M. Viroli. On variance-based subtyping for parametric types. In Proceedings of ECOOP '02. Springer LNCS 2374, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Krishnamurthi, M. Felleisen, and D. P. Friedman. Synthesizing object-oriented and functional design to promote re-use. In Proceedings of ECOOP '98, LNCS 1445, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. Object Oriented Programming in the Beta Programming Language. Addison-Wesley, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. O. L. Madsen and B. Møller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings of OOPSLA '89. ACM SIGPLAN Notices 24(10), pages 397--406, 1989.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Mezini and K. Ostermann. Integrating independent components with on-demand remodularization. In Proceedings OOPSLA '02, ACM SIGPLAN Notices 37(11), pages 52--67, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Mezini and K. Ostermann. Conquering aspects with Caesar. In Proceedings AOSD '03, pages 90--99. ACM, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Mezini and K. Ostermann. Modules for crosscutting models. In International Conference on Reliable Software Technologies. Springer LNCS 2655, 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  25. N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In Proceedings OOPSLA '04, pages 99--115. ACM Press, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Odersky, V. Cremet, C. Röckl, and M. Zenger. A nominal theory of objects with dependent types. In Proceedings ECOOP '03. Springer LNCS, 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  27. M. Odersky and M. Zenger. Scalable component abstractions. In OOPSLA '05: Proceedings ACM SIGPLAN Conference on Object oriented programming systems languages and applications, pages 41--57. ACM Press, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. K. Ostermann. Dynamically composable collaborations with delegation layers. In Proceedings of ECOOP '02. LNCS 2374, pages 89--110. Springer, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. B. C. Pierce. Types and Programming Languages. MIT Press, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Y. Smaragdakis and D. Batory. Implementing layered designs with mixin-layers. In Proceedings of ECOOP '98, LNCS 1445, pages 550--570, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. P. Tarr, H. Ossher, W. Harrison, and S. M. Sutton. N degrees of separation: Multi-dimensional separation of concerns. In Proceedings International Conference on Software Engineering (ICSE) '99, pages 107--119. ACM Press, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. K. K. Thorup. Genericity in Java with virtual types. In Proceedings ECOOP '97. LNCS 1241, pages 444--471, 1997.]]Google ScholarGoogle ScholarCross RefCross Ref
  33. K. K. Thorup and M. Torgersen. Unifying genericity - combining the benefits of virtual types and parameterized classes. In Proceedings ECOOP '99, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. Torgersen. The expression problem revisited. In European Conference on Object-Oriented Programming, 2004.]]Google ScholarGoogle ScholarCross RefCross Ref
  35. M. Torgersen, E. Ernst, C. P. Hansen, P. von~der Ahé, G. Bracha, and N. Gafter. Adding wildcards to the Java programming language. Journal of Object Technology, 3(11):97--116, Dec. 2004. http://www.jot.fm/issues/issue_2004_12/article5.]]Google ScholarGoogle ScholarCross RefCross Ref
  36. P. Wadler. The expression problem. Message to java-genericity electronic mailing list, November 1998.]]Google ScholarGoogle Scholar
  37. M. Zenger. Personal communication, 2003.]]Google ScholarGoogle Scholar
  38. M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. Technical Report IC/2004/33, École Polytechnique Fédérale de Lausanne, 2004.]]Google ScholarGoogle Scholar

Index Terms

  1. A virtual class calculus

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                January 2006
                432 pages
                ISBN:1595930272
                DOI:10.1145/1111037
                • cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 41, Issue 1
                  Proceedings of the 2006 POPL Conference
                  January 2006
                  421 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/1111320
                  Issue’s Table of Contents

                Copyright © 2006 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 11 January 2006

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • Article

                Acceptance Rates

                Overall Acceptance Rate824of4,130submissions,20%

                Upcoming Conference

                POPL '25

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader