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.
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- G. Bracha and W. Cook. Mixin-based inheritance. In Proceedings OOPSLA/ECOOP'90. ACM SIGPLAN Notices 25(10), pages 303--311. ACM, 1990.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- E. Ernst. Propagating class and method combination. In Proceedings ECOOP'99, LNCS 1628, pages 67--91, Lisboa, Portugal, June 1999. Springer-Verlag.]] Google ScholarDigital Library
- E. Ernst. Family polymorphism. In Proceedings ECOOP '01, LNCS 2072, pages 303--326. Springer, 2001.]] Google ScholarDigital Library
- E. Ernst. Higher-order hierarchies. In Proceedings ECOOP '03, LNCS. Springer, 2003.]]Google ScholarCross Ref
- E. Ernst, K. Ostermann, and W. Cook. A virtual class calculus. Technical report, University of Aarhus, Aarhus, Denmark, 2005.]]Google Scholar
- K. Fisher and J. Reppy. Statically typed traits. Technical Report TR-2003-13, University of Chicago, Chicago, USA, 2003.]]Google Scholar
- 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 ScholarDigital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison Wesley, 1995.]]Google Scholar
- C. A. Gunter. Semantics of Programming Languages: Structures and Techniques. Foundations of Computing. MIT Press, 1992.]] Google ScholarDigital Library
- R. Harrejon, D. Batory, and W. R. Cook. Evaluating support for features in advanced modularization technologies. In Proceedings ECOOP '05. Springer, 2005.]] Google ScholarDigital Library
- A. Igarashi and B. Pierce. Foundations for virtual types. Information and Computation, 175(1):34--49, 2002.]]Google ScholarCross Ref
- 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 ScholarDigital Library
- A. Igarashi and M. Viroli. On variance-based subtyping for parametric types. In Proceedings of ECOOP '02. Springer LNCS 2374, 2002.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. Object Oriented Programming in the Beta Programming Language. Addison-Wesley, 1993.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- M. Mezini and K. Ostermann. Conquering aspects with Caesar. In Proceedings AOSD '03, pages 90--99. ACM, 2003.]] Google ScholarDigital Library
- M. Mezini and K. Ostermann. Modules for crosscutting models. In International Conference on Reliable Software Technologies. Springer LNCS 2655, 2003.]]Google ScholarCross Ref
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In Proceedings OOPSLA '04, pages 99--115. ACM Press, 2004.]] Google ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- K. Ostermann. Dynamically composable collaborations with delegation layers. In Proceedings of ECOOP '02. LNCS 2374, pages 89--110. Springer, 2002.]] Google ScholarDigital Library
- B. C. Pierce. Types and Programming Languages. MIT Press, 2002.]] Google ScholarDigital Library
- Y. Smaragdakis and D. Batory. Implementing layered designs with mixin-layers. In Proceedings of ECOOP '98, LNCS 1445, pages 550--570, 1998.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- K. K. Thorup. Genericity in Java with virtual types. In Proceedings ECOOP '97. LNCS 1241, pages 444--471, 1997.]]Google ScholarCross Ref
- K. K. Thorup and M. Torgersen. Unifying genericity - combining the benefits of virtual types and parameterized classes. In Proceedings ECOOP '99, 1999.]] Google ScholarDigital Library
- M. Torgersen. The expression problem revisited. In European Conference on Object-Oriented Programming, 2004.]]Google ScholarCross Ref
- 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 ScholarCross Ref
- P. Wadler. The expression problem. Message to java-genericity electronic mailing list, November 1998.]]Google Scholar
- M. Zenger. Personal communication, 2003.]]Google Scholar
- 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 Scholar
Index Terms
- A virtual class calculus
Recommendations
Tribe: a simple virtual class calculus
AOSD '07: Proceedings of the 6th international conference on Aspect-oriented software developmentBeginning with BETA, a range of programming language mechanisms such as virtual classes (class-valued attributes of objects) have been developed to allow inheritance in the presence of mutually dependent classes. This paper presents Tribe, a type system ...
A virtual class calculus
Proceedings of the 2006 POPL ConferenceVirtual 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 ...
Virtual class support at the virtual machine level
VMIL '09: Proceedings of the Third Workshop on Virtual Machines and Intermediate LanguagesThis paper describes how virtual classes can be supported in a virtual machine. Main-stream virtual machines such as the Java Virtual Machine and the .NET platform dominate the world today, and many languages are being executed on these virtual machines ...
Comments