skip to main content
article

Dependent classes

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

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 42, Issue 10
Proceedings of the 2007 OOPSLA conference
October 2007
686 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1297105
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications
    October 2007
    728 pages
    ISBN:9781595937865
    DOI:10.1145/1297027
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: 21 October 2007
Published in SIGPLAN Volume 42, Issue 10

Check for updates

Author Tags

  1. dependent classes
  2. dynamic dispatch
  3. multimethods
  4. multiple dispatch
  5. variability
  6. virtual classes

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)1
Reflects downloads up to 20 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2011)JavaGIACM Transactions on Programming Languages and Systems10.1145/1985342.198534333:4(1-83)Online publication date: Jul-2011
  • (2018)Towards safe modular composition of network functionsCompanion Proceedings of the 2nd International Conference on the Art, Science, and Engineering of Programming10.1145/3191697.3213804(81-86)Online publication date: 9-Apr-2018
  • (2017)Type soundness proofs with definitional interpretersACM SIGPLAN Notices10.1145/3093333.300986652:1(666-679)Online publication date: 1-Jan-2017
  • (2017)Type soundness proofs with definitional interpretersProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009866(666-679)Online publication date: 1-Jan-2017
  • (2016)Type soundness for dependent object types (DOT)ACM SIGPLAN Notices10.1145/3022671.298400851:10(624-641)Online publication date: 19-Oct-2016
  • (2016)Type soundness for dependent object types (DOT)Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2983990.2984008(624-641)Online publication date: 19-Oct-2016
  • (2014)Foundations of path-dependent typesACM SIGPLAN Notices10.1145/2714064.266021649:10(233-249)Online publication date: 15-Oct-2014
  • (2014)Foundations of path-dependent typesProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660216(233-249)Online publication date: 15-Oct-2014
  • (2013)Confined roles and decapsulation in object teamsAliasing in Object-Oriented Programming10.5555/2554511.2554533(443-470)Online publication date: 1-Jan-2013
  • (2013)Implementing Feature Interactions with Generic Feature ModulesSoftware Composition10.1007/978-3-642-39614-4_6(81-96)Online publication date: 2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media