skip to main content
10.1145/2509136.2509535acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Forsaking inheritance: supercharged delegation in DelphJ

Published:29 October 2013Publication History

ABSTRACT

We propose DelphJ: a Java-based OO language that eschews inheritance completely, in favor of a combination of class morphing and (deep) delegation. Compared to past delegation approaches, the novel aspect of our design is the ability to emulate the best aspects of inheritance while retaining maximum flexibility: using morphing, a class can select any of the methods of its delegatee and export them (if desired) or transform them (e.g., to add extra arguments or modify type signatures), yet without needing to name these methods explicitly and handle them one-by-one. Compared to past work on morphing, our approach adopts and adapts advanced delegation mechanisms, in order to add late binding capabilities and, thus, provide a full substitute of inheritance. Additionally, we explore complex semantic issues in the interaction of delegation with late binding. We present our language design both informally, with numerous examples, and formally in a core calculus.

References

  1. Lorenzo Bettini, Viviana Bono, and Betti Venneri. Delegation by object composition. Science of Computer Programming, 76(11):992--1014, November 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Lorenzo Bettini, Sara Capecchi, and Elena Giachino. Featherweight wrap java. In Proc. Symp. on Applied Computing (SAC), pages 1094--1100, Seoul, Republic of Korea, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Gilad Bracha and William Cook. Mixin-based inheritance. In Proc. European Conference on Object-Oriented Programming (ECOOP), volume 25, pages 303--311, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Martin Büchi and Wolfgang Weck. Generic wrappers. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 201--225, Sophia Antipolis and Cannes, France, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. William R. Cook, Walter Hill, and Peter S. Canning. Inheritance is not subtyping. In Proc. Symp. on Principles of Programming Languages (POPL), pages 125--135, San Francisco, USA, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Stéphane Ducasse, Oscar Nierstrasz, Nathanael Schärli, Roel Wuyts, and Andrew P. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems, 28(2):331--388, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Torbjörn Ekman and Görel Hedin. The JastAdd extensible Java compiler. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 1--18, New York, NY, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and mixins. In Proc. Symp. on Principles of Programming Languages (POPL), pages 171--183, San Diego, USA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Allen Holub. Why extends is evil: Improve your code by replacing concrete base classes with interfaces. http://www.javaworld.com/javaworld/jw-08--2003/jw-0801-toolbox.html, August 2003.Google ScholarGoogle Scholar
  10. Shan Shan Huang and Yannis Smaragdakis. Expressive and safe static reflection with MorphJ. In Proc. Conf. on Programming Language Design and Implementation (PLDI), volume 43, pages 79--89, Tucson, AZ, USA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Shan Shan Huang and Yannis Smaragdakis. Morphing: Structurally shaping a class by reflecting on others. ACM Transactions on Programming Languages and Systems, 33(2):1--44, February 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Shan Shan Huang, David Zook, and Yannis Smaragdakis. Morphing: Safely shaping a class in the image of others. In Erik Ernst, editor, Proc. European Conference on Object-Oriented Programming (ECOOP), volume 4609 of LNCS, pages 303--329, July 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Atshushi 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Tetsuo Kamina and Tetsuo Tamai. McJava -- a design and implementation of java with mixin-types. In Proc. of Asian Programming Languages and Systems Symp. (APLAS), pages 4--6, Taipei, Taiwan, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  15. Tetsuo Kamina and Tetsuo Tamai. Selective method combination in mixin-based composition. In Proc. Symp. on Applied Computing (SAC), pages 1269--1273, Santa Fe, New Mexico, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Majorinc Kazimir. Ellipse-circle dilemma and inverse inheritance. In Proceedings of the 20th International Conference on Information Technology Interfaces, Pula, Croatia, 1998.Google ScholarGoogle Scholar
  17. Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 327--353, London, UK, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Gregor Kiczales, John Lamping, Anurag Menhdhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-oriented programming. In Proc. European Conference on Object-Oriented Programming (ECOOP), volume 1241, pages 220--242. Springer, Heidelberg, Germany, and New York, 1997.Google ScholarGoogle ScholarCross RefCross Ref
  19. Günter Kniesel. Type-safe delegation for run-time component adaptation. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 351--366, Lisbon, Portugal, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Günter Kniesel. Dynamic object-based inheritance with subtyping. PhD thesis, Universität Bonn Institut für Informatik III, 2000.Google ScholarGoogle Scholar
  21. Günter Kniesel, Mechthild Rohen, and Armin B. Cremers. A management system for distributed knowledge base applications. In Verteilte Künstliche Intelligenz und kooperatives Arbeiten, 4. Internationaler GI-Kongress Wissensbasierte Systeme, pages 65--76, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Henry Lieberman. Using prototypical objects to implement shared behavior in object-oriented systems. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 214--223, New York, NY, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mira Mezini. Dynamic object evolution without name collisions. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 190--219, Jyv\"askyl\"a, Finland, 1997.Google ScholarGoogle ScholarCross RefCross Ref
  24. Leonid Mikhajlov and Emil Sekerinski. A study of the fragile base class problem. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 355--382, Brussels, Belgium, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Klaus Ostermann. Dynamically composable collaborations with delegation layers. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 89--110, Nantes, France, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Klaus Ostermann and Mira Mezini. Object-oriented composition untangled. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 283--299, New York, NY, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Klaus Ostermann and Mira Mezini. Blurring the borders between object composition, inheritance, and delegation. In Proceedings of the Inheritance Workshop at the 16th European Conference on Object-Oriented Programming, pages 65--68, 2008.Google ScholarGoogle Scholar
  28. Nathanael Scharli, Stephane Ducasse, Oscar Nierstrasz, and Andrew Black. Traits: Composable units of behavior. In Proc. European Conference on Object-Oriented Programming (ECOOP), Darmstadt, Germany, 2003.Google ScholarGoogle Scholar
  29. Hans Schippers, Michael Haupt, and Robert Hirschfeld. An implementation substrate for languages composing modularized crosscutting concerns. In Proc. Symp. on Applied Computing (SAC), SAC '09, pages 1944--1951, New York, NY, USA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Hans Schippers, Dirk Janssens, Michael Haupt, and Robert Hirschfeld. Delegation-based semantics for modularizing crosscutting concerns. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 525--542, New York, NY, USA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Marcelo Sihman and Shmuel Katz. Superimpositions and aspect-oriented programming. The Computer Journal, 46(5):529--541, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  32. David Ungar and Randall B. Smith. Self: The power of simplicity. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 227--242, New York, NY, USA, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library

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
  • Published in

    cover image ACM Conferences
    OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applications
    October 2013
    904 pages
    ISBN:9781450323741
    DOI:10.1145/2509136

    Copyright © 2013 ACM

    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: 29 October 2013

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    OOPSLA '13 Paper Acceptance Rate50of189submissions,26%Overall Acceptance Rate268of1,244submissions,22%

    Upcoming Conference

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader