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

Scalable extensibility via nested inheritance

Published: 01 October 2004 Publication History

Abstract

Inheritance is a useful mechanism for factoring and reusing code. However, it has limitations for building extensible systems. We describe <i>nested inheritance</i>, a mechanism that addresses some of the limitations of ordinary inheritance and other code reuse mechanisms. Using our experience with an extensible compiler framework, we show how nested inheritance can be used to construct highly extensible software frameworks. The essential aspects of nested inheritance are formalized in a simple object-oriented language with an operational semantics and type system. The type system of this language is sound, so no run-time type checking is required to implement it and no run-time type errors can occur. We describe our implementation of nested inheritance as an unobtrusive extension of the Java language, called Jx. Our prototype implementation translates Jx code to ordinary Java code, without duplicating inherited code.

References

[1]
Davide Ancona, Giovanni Lagorio, and Elena Zucca. Jam: A smooth extension of Java with mixins. In Proc. ECOOP '00, LNCS 1850, pages 154--178, Cannes, France, 2000.]]
[2]
Gilad Bracha and William Cook. Mixin-based inheritance. In Norman Meyrowitz, editor, Proc. OOPSLA '90, pages 303--311, Ottawa, Canada, 1990. ACM Press.]]
[3]
Kim B. Bruce, Adrian Fiech, and Leaf Petersen. Subtyping is not a good "match" for object-oriented languages. In Proceedings of 11th European Conference on Object-Oriented Programming (ECOOP'97), number 1241 in Lecture Notes in Computer Science, pages 104--127, Jyväskylä, Finland, June 1997. Springer-Verlag.]]
[4]
Kim B. Bruce, Martin Odersky, and Philip Wadler. A statically safe alternative to virtual types. In European Conference on Object-Oriented Programming (ECOOP), number 1445 in Lecture Notes in Computer Science, pages 523--549, Brussels, Belgium, July 1998. Springer-Verlag.]]
[5]
Kim B. Bruce, Angela Schuett, and Robert van Gent. PolyTOIL: A type-safe polymorphic object-oriented language. In European Conference on Object-Oriented Programming (ECOOP), number 952 in Lecture Notes in Computer Science, pages 27--51. Springer-Verlag, 1995.]]
[6]
Curtis Clifton, Gary T. Leavens, Craig Chambers, and Todd Millstein. MultiJava: Modular open classes and symmetric multiple dispatch for Java. In OOPSLA 2000 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Minneapolis, Minnesota, volume 35(10), pages 130--145, 2000.]]
[7]
O.-J. Dahl et al. The Simula 67 common base language. Publication No. S-22, Norwegian Computing Center, Oslo, 1970.]]
[8]
Erik Ernst. gbeta - a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Aarhus, Århus, Denmark, 1999.]]
[9]
Erik Ernst. Family polymorphism. In Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP), LNCS 2072, pages 303--326, Heidelberg, Germany, 2001. Springer-Verlag.]]
[10]
Erik Ernst. Higher-order hierarchies. In Proceedings of the 17th European Conference on Object-Oriented Programming (ECOOP), volume 2743 of Lecture Notes in Computer Science, pages 303--329, Heidelberg, Germany, July 2003. Springer-Verlag.]]
[11]
Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and mixins. In Proc. 25th ACM Symp. on Principles of Programming Languages (POPL), pages 171--183, San Diego, California, 1998.]]
[12]
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Reading, MA, 1994.]]
[13]
James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification. Addison Wesley, 2nd edition, 2000. ISBN 0-201-31008-2.]]
[14]
Carl Gunter and John C. Mitchell, editors. Theoretical aspects of object-oriented programming. MIT Press, 1994.]]
[15]
Atsushi Igarashi, Benjamin Pierce, and Philip Wadler. Foundations for virtual types. In Proceedings of the Thirteenth European Conference on Object-Oriented Programming (ECOOP'99), number 1628 in Lecture Notes in Computer Science, pages 161--185. Springer-Verlag, June 1999.]]
[16]
Atsushi Igarashi, Benjamin Pierce, and Philip Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396--450, 2001.]]
[17]
Atsushi Igarashi and Benjamin C. Pierce. On inner classes. Information and Computation, 177(1):56--89, August 2002.]]
[18]
Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersen, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Proceedings of European Conference on Object-Oriented Programming (ECOOP'01), volume 2072 of Lecture Notes in Computer Science, pages 327--353, Berlin, Heidelberg, and New York, 2001. Springer-Verlag.]]
[19]
Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-oriented programming. In Proceedings of 11th European Conference on Object-Oriented Programming (ECOOP'97), number 1241 in Lecture Notes in Computer Science, pages 220-242, Jyväskylä, Finland, June 1997. Springer-Verlag.]]
[20]
B. Liskov et al. CLU reference manual. In Goos and Hartmanis, editors, Lecture Notes in Computer Science, volume 114. Springer-Verlag, Berlin, 1981.]]
[21]
O. Lehrmann Madsen, B. Moller-Pedersen, and K. Nygaard. Object Oriented Programming in the BETA Programming Language. Addison-Wesley, June 1993.]]
[22]
Ole Lehrmann Madsen and Birger Moller-Pedersen. Virtual classes: A poweful mechanism for object-oriented programming. In Proc. OOPSLA '89, pages 397--406, October 1989.]]
[23]
Sean McDirmid, Matthew Flatt, and Wilson C. Hsieh. Jiazzi: New-age components for old-fashioned Java. In Proc. OOPSLA '01, October 2001.]]
[24]
Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990.]]
[25]
Andrew C. Myers, Lantian Zheng, Steve Zdancewic, Stephen Chong, and Nathaniel Nystrom. Jif: Java information flow. Software release. Located at http://www.cs.cornell.edu/jif, July 2001-2003.]]
[26]
Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers. Scalable extensibility via nested inheritance. Technical Report 2004-1940, Computer Science Dept., Cornell University, June 2004.]]
[27]
Nathaniel Nystrom, Michael Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In Görel Hedin, editor, Compiler Construction, 12th International Conference, CC 2003, number 2622 in Lecture Notes in Computer Science, pages 138--152, Warsaw, Poland, April 2003. Springer-Verlag.]]
[28]
Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stephane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. An overview of the Scala programming language, June 2004. http://scala.epfl.ch/docu/files/-ScalaOverview.pdf.]]
[29]
Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. A nominal theory of objects with dependent types. In Proceedings of 17th European Conference on Object-Oriented Programming (ECOOP 2003), number 2743 in Lecture Notes in Computer Science, pages 201--224. Springer-Verlag, July 2003.]]
[30]
Martin Odersky and Christoph Zenger. Nested types. In 8th Workshop on Foundations of Object-Oriented Languages (FOOL), 2001.]]
[31]
Klaus Ostermann. Dynamically composable collaborations with delegation layers. In Proceedings of the 16th European Conference on Object-Oriented Programming (ECOOP), volume 2374 of Lecture Notes in Computer Science, pages 89--110, Málaga, Spain, 2002. Springer-Verlag.]]
[32]
John C. Reynolds. User-defined types and procedural data structures as complementary approaches to data abstraction. In Stephen A. Schuman, editor, New Directions in Algorithmic Languages, pages 157--168. Institut de Recherche d'Informatique et d'Automatique, Le Chesnay, France, 1975. Reprinted in {14}, pages 13--23.]]
[33]
Yannis Smaragdakis and Don Batory. Implementing layered design with mixin layers. In Eric Jul, editor, Proceedings ECOOP'98, pages 550--570, Brussels, Belgium, 1998.]]
[34]
B. Stroustrup. The C++ Programming Language. Addison-Wesley, 1987.]]
[35]
Kresten Krab Thorup. Genericity in Java with virtual types. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), number 1241 in Lecture Notes in Computer Science, pages 444--471. Springer-Verlag, 1997.]]
[36]
Mads Torgerson. Virtual types are statically safe. In 5th Workshop on Foundations of Object-Oriented Languages (FOOL), January 1998.]]
[37]
Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994.]]
[38]
Matthias Zenger and Martin Odersky. Extensible algebraic datatypes with defaults. In Proc. 6th ACM SIGPLAN International Conference on Functional Programming (ICFP), Firenze, Italy, September 2001.]]
[39]
Matthias Zenger and Martin Odersky. Independently extensible solutions to the expression problem. Technical Report IC/2004/33, École Polytechnique Fédérale de Lausanne, March 2004.]]

Cited By

View all
  • (2024)Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional TypingProceedings of the ACM on Programming Languages10.1145/36897828:OOPSLA2(2010-2039)Online publication date: 8-Oct-2024
  • (2024)Persimmon: Nested Family Polymorphism with Extensible Variant TypesProceedings of the ACM on Programming Languages10.1145/36498368:OOPSLA1(698-724)Online publication date: 29-Apr-2024
  • (2023)Extensible Metatheory Mechanization via Family PolymorphismProceedings of the ACM on Programming Languages10.1145/35912867:PLDI(1608-1632)Online publication date: 6-Jun-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
October 2004
462 pages
ISBN:1581138318
DOI:10.1145/1028976
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 39, Issue 10
    OOPSLA '04
    October 2004
    448 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1035292
    Issue’s Table of Contents
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2004

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. inheritance
  2. nested classes
  3. object-oriented programming languages
  4. virtual classes

Qualifiers

  • Article

Conference

OOPSLA04

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2024)Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional TypingProceedings of the ACM on Programming Languages10.1145/36897828:OOPSLA2(2010-2039)Online publication date: 8-Oct-2024
  • (2024)Persimmon: Nested Family Polymorphism with Extensible Variant TypesProceedings of the ACM on Programming Languages10.1145/36498368:OOPSLA1(698-724)Online publication date: 29-Apr-2024
  • (2023)Extensible Metatheory Mechanization via Family PolymorphismProceedings of the ACM on Programming Languages10.1145/35912867:PLDI(1608-1632)Online publication date: 6-Jun-2023
  • (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
  • (2017)Safe model polymorphism for flexible modelingComputer Languages, Systems and Structures10.1016/j.cl.2016.09.00149:C(176-195)Online publication date: 1-Sep-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
  • (2016)Matriona: class nesting with parameterization in Squeak/SmalltalkProceedings of the 15th International Conference on Modularity10.1145/2889443.2889457(118-129)Online publication date: 14-Mar-2016
  • (2016)ThisType for Object-Oriented LanguagesACM Transactions on Programming Languages and Systems10.1145/288839238:3(1-66)Online publication date: 8-Apr-2016
  • 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