ABSTRACT
Virtual classes allow nested classes to be refined in subclasses. In this way nested classes can be seen as dependent abstractions of the objects of the enclosing classes. Expressing dependency via nesting, however, has two limitations: Abstractions that depend on more than one object cannot be modeled and a class must know all classes that depend on its objects. This paper presents dependent classes, a generalization of virtual classes that expresses similar semantics by parameterization rather than by nesting. This increases expressivity of class variations as well as the flexibility of their modularization. Besides, dependent classes complement multimethods in scenarios where multi-dispatched abstractions rather than multi-dispatched methods are needed. They can also be used to express more precise signatures of multimethods and even extend their dispatch semantics. We present a formal semantics of dependent classes and a machine-checked type soundness proof in Isabelle/HOL [29], the first of this kind for a language with virtual classes and path-dependent types.
- I. Aracic, V. Gasiunas, M. Mezini, and K. Ostermann. An overview of CaesarJ. Transactions on Aspect-Oriented Software Development, 3880:135--173, 2006. Google Scholar
Digital Library
- G. Castagna, G. Ghelli, and G. Longo. A calculus for overloaded functions with subtyping. In LFP '92: Proceedings of the 1992 ACM conference on LISP and functional programming, pages 182--192, New York, NY, USA, 1992. ACM Press. Google Scholar
Digital Library
- C. Chambers. Object-oriented multi-methods in Cecil. In Proceedings ECOOP '92, LNCS 615, pages 33--56. Springer, 1992. Google Scholar
Digital Library
- C. Chambers and G. T. Leavens. Typechecking and modules for multi-methods. In Proceedings OOPSLA '94, pages 1--15, New York, NY, USA, 1994. ACM Press. Google Scholar
Digital Library
- D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: A Simple Virtual Class Calculus. In Proceedings of AOSD'07, 2007. Google Scholar
Digital Library
- C. Clifton, G. T. Leavens, C. Chambers, and T. Millstein. Multijava: modular open classes and symmetric multiple dispatch for java. SIGPLAN Not., 35(10):130--145, 2000. Google Scholar
Digital Library
- T. Coquand and G. Huet. The calculus of constructions. Inf. Comput., 76(2--3):95--120, 1988. Google Scholar
Digital Library
- V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In Proceedings MFCS, Springer LNCS, Sept. 2006. Google Scholar
Digital Library
- L. DeMichiel and R. Gabriel. The Common Lisp Object System: An overview. In Proceedings ECOOP '87, pages 243--252, 1987. Google Scholar
Digital Library
- E. Ernst. Family polymorphism. In Proceedings ECOOP '01, pages 303--326, London, UK, 2001. Springer-Verlag. Google Scholar
Digital Library
- E. Ernst. Higher-order hierarchies. In L. Cardelli, editor, Proceedings ECOOP '03, LNCS 2743, pages 303--329. Springer-Verlag, 2003.Google Scholar
- E. Ernst, K. Ostermann, and W. Cook. A virtual class calculus. In Proceedings POPL '06, pages 270--282. ACM Press, 2006. Google Scholar
Digital Library
- M. D. Ernst, C. Kaplan, and C. Chambers. Predicate dispatching: A unified theory of dispatch. In Proceedings ECOOP '98, volume 1445 of LNCS, pages 186--211. Springer, 1998. Google Scholar
Digital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison Wesley, 1995.Google Scholar
- V. Gasiunas, M. Mezini, and K. Ostermann. Formal soundness proof of the vcn calculus, 2006. http://www.st.informatik.tu-darmstadt.de/static/pages/projects/mvc/index.htm.Google Scholar
- D. Hutchins. Eliminating distinctions of class: using prototypes to model virtual classes. In Proceedings OOPSLA '06, pages 1--20. ACM Press, 2006. Google Scholar
Digital Library
- A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396--450, 1999. Google Scholar
Digital Library
- A. Igarashi, C. Saito, and M. Viroli. Lightweight family polymorphism. In Programming Languages and Systems, Third Asian Symposium (APLAS'05), pages 161--177. Springer LNCS 3780, 2005. Google Scholar
Digital Library
- P. Jolly, S. Drossopoulou, C. Anderson, and K. Ostermann. Simple dependent types: Concord. In Workshop on Formal Techniques for Java--like Programs at ECOOP 2004, 2004. Google Scholar
Digital Library
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In Proceedings ECOOP '01, pages 327--353, London, UK, 2001. Springer-Verlag. Google Scholar
Digital Library
- RLämmel and K. Ostermann. Software extension and integration with type classes. In GPCE'06. ACM Press, Oct. 2006. Google Scholar
Digital Library
- O. L. Madsen and B. Möller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings OOPSLA '89, pages 397--406. ACM Press, 1989. Google Scholar
Digital Library
- M. Mezini and K. Ostermann. Integrating independent components with on--demand remodularization. In Proceedings OOPSLA '02, pages 52--67. ACM Press, 2002. Google Scholar
Digital Library
- M. Mezini and K. Ostermann. Conquering aspects with Caesar. In Proceedings AOSD '03, pages 90--99. ACM Press, 2003. Google Scholar
Digital Library
- M. Mezini and K. Ostermann. Variability management with feature--oriented programming and aspects. In Proceedings SIGSOFT '04/FSE-12, pages 127--136. ACM Press, 2004. Google Scholar
Digital Library
- T. Millstein. Practical predicate dispatch. In Proceedings OOPSLA '04, pages 345--364. ACM Press, 2004. Google Scholar
Digital Library
- T. Millstein and C. Chambers. Modular statically typed multimethods. In Proceedings ECOOP '99, volume 1628 of Lecture Notes in Computer Science, pages 279--303. Springer Verlag, 1999. Google Scholar
Digital Library
- T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL -A Proof Assistant for Higher-Order Logic, volume 2283 of LNCS. Springer, 2002.Google Scholar
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. SIGPLAN Not., 39(10):99--115, 2004. Google Scholar
Digital Library
- N. Nystrom, X. Qi, and A. C. Myers. J&: nested intersection for scalable software composition. In Proceedings OOPSLA '06, pages 21--36. ACM Press, 2006. Google Scholar
Digital 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 Scholar
Cross Ref
- M. Odersky and M. Zenger. Scalable component abstractions. In Proceedings OOPSLA '05, pages 41--57, New York, NY, USA, 2005. ACM Press. Google Scholar
Digital Library
- A. Shalit. The Dylan reference manual: the definitive guide to the new object-oriented dynamic language. Addison Wesley, Redwood, CA, USA, 1996. Google Scholar
Digital Library
- M. J. Simon Peyton Jones and E. Meijer. Type classes: exploring the design space. In Procedings of the Haskell Workshop 1997, June 1997.Google Scholar
- A. Warth, M. Stanojevic, and T. Millstein. Statically scoped object adaptation with expanders. In Proceedings OOPSLA '06, pages 37--56. ACM Press, 2006. Google Scholar
Digital Library
- A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Google Scholar
Digital Library
Index Terms
Dependent classes
Recommendations
Dependent classes
Proceedings of the 2007 OOPSLA conferenceVirtual classes allow nested classes to be refined in subclasses. In this way nested classes can be seen as dependent abstractions of the objects of the enclosing classes. Expressing dependency via nesting, however, has two limitations: Abstractions ...
Lightweight dependent classes
GPCE '08: Proceedings of the 7th international conference on Generative programming and component engineeringExtensive research efforts have been devoted to implement a group of type-safe mutually recursive classes; recently, proposals for separating each member of the group as a reusable and composable programming unit have also been presented. One problem of ...
A virtual class calculus
POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesVirtual 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 ...







Comments