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.
- Lorenzo Bettini, Viviana Bono, and Betti Venneri. Delegation by object composition. Science of Computer Programming, 76(11):992--1014, November 2011. Google ScholarDigital Library
- 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 ScholarDigital Library
- Gilad Bracha and William Cook. Mixin-based inheritance. In Proc. European Conference on Object-Oriented Programming (ECOOP), volume 25, pages 303--311, 1990. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Majorinc Kazimir. Ellipse-circle dilemma and inverse inheritance. In Proceedings of the 20th International Conference on Information Technology Interfaces, Pula, Croatia, 1998.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Günter Kniesel. Dynamic object-based inheritance with subtyping. PhD thesis, Universität Bonn Institut für Informatik III, 2000.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Klaus Ostermann. Dynamically composable collaborations with delegation layers. In Proc. European Conference on Object-Oriented Programming (ECOOP), pages 89--110, Nantes, France, 2006. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Marcelo Sihman and Shmuel Katz. Superimpositions and aspect-oriented programming. The Computer Journal, 46(5):529--541, 2003.Google ScholarCross Ref
- 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 ScholarDigital Library
Recommendations
Forsaking inheritance: supercharged delegation in DelphJ
OOPSLA '13We 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 ...
PBDM: a flexible delegation model in RBAC
SACMAT '03: Proceedings of the eighth ACM symposium on Access control models and technologiesRole-based access control (RBAC) is recognized as an efficient access control model for large organizations. Most organizations have some business rules related to access control policy. Delegation of authority is among these rules. RBDM0 and RDM2000 ...
Delegation by object composition
Class inheritance and method overriding, as provided by standard class-based languages, are often not flexible enough to represent objects with some dynamic behavior. In this respect, object composition equipped with different forms of method body ...
Comments