skip to main content
10.1145/1297027.1297038acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Dependent classes

Authors Info & Claims
Published:21 October 2007Publication History

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.

References

  1. I. Aracic, V. Gasiunas, M. Mezini, and K. Ostermann. An overview of CaesarJ. Transactions on Aspect-Oriented Software Development, 3880:135--173, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Chambers. Object-oriented multi-methods in Cecil. In Proceedings ECOOP '92, LNCS 615, pages 33--56. Springer, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: A Simple Virtual Class Calculus. In Proceedings of AOSD'07, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. T. Coquand and G. Huet. The calculus of constructions. Inf. Comput., 76(2--3):95--120, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In Proceedings MFCS, Springer LNCS, Sept. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. L. DeMichiel and R. Gabriel. The Common Lisp Object System: An overview. In Proceedings ECOOP '87, pages 243--252, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Ernst. Family polymorphism. In Proceedings ECOOP '01, pages 303--326, London, UK, 2001. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. Ernst. Higher-order hierarchies. In L. Cardelli, editor, Proceedings ECOOP '03, LNCS 2743, pages 303--329. Springer-Verlag, 2003.Google ScholarGoogle Scholar
  12. E. Ernst, K. Ostermann, and W. Cook. A virtual class calculus. In Proceedings POPL '06, pages 270--282. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison Wesley, 1995.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle Scholar
  16. D. Hutchins. Eliminating distinctions of class: using prototypes to model virtual classes. In Proceedings OOPSLA '06, pages 1--20. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. RLämmel and K. Ostermann. Software extension and integration with type classes. In GPCE'06. ACM Press, Oct. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Mezini and K. Ostermann. Integrating independent components with on--demand remodularization. In Proceedings OOPSLA '02, pages 52--67. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Mezini and K. Ostermann. Conquering aspects with Caesar. In Proceedings AOSD '03, pages 90--99. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Millstein. Practical predicate dispatch. In Proceedings OOPSLA '04, pages 345--364. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL -A Proof Assistant for Higher-Order Logic, volume 2283 of LNCS. Springer, 2002.Google ScholarGoogle Scholar
  29. N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. SIGPLAN Not., 39(10):99--115, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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
  32. M. Odersky and M. Zenger. Scalable component abstractions. In Proceedings OOPSLA '05, pages 41--57, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. A. Shalit. The Dylan reference manual: the definitive guide to the new object-oriented dynamic language. Addison Wesley, Redwood, CA, USA, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. J. Simon Peyton Jones and E. Meijer. Type classes: exploring the design space. In Procedings of the Haskell Workshop 1997, June 1997.Google ScholarGoogle Scholar
  35. A. Warth, M. Stanojevic, and T. Millstein. Statically scoped object adaptation with expanders. In Proceedings OOPSLA '06, pages 37--56. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dependent classes

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!