skip to main content
10.1145/1411732.1411756acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Type safe dynamic object delegation in class-based languages

Published: 09 September 2008 Publication History

Abstract

Class inheritance and method overriding, as provided by standard class-based languages, are not flexible enough to represent the dynamic behavior of objects; with this respect, object composition and delegation are often advocated as a more flexible alternative to class inheritance since they act at run-time, thus permitting the behavior of objects to be specialized dynamically. In this paper we present Incomplete Featherweight Java (IFJ), an extension of Featherweight Java with incomplete objects, i.e., objects that require some missing methods which can be provided at run-time by composition with another (complete) object. The mechanism for method invocation is based on delegation and it is disciplined by static typing, therefore the language enjoys type safety (which implies no "message-not-understood" run-time errors) and avoids possible accidental overrides due to method clashes.

References

[1]
C. Anderson, F. Barbanera, M. Dezani-Ciancaglini, and S. Drossopoulou. Can Addresses be Types? (a case study: Objects with Delegation). In WOOD'03, volume 82(8) of ENTCS, pages 1--22. Elsevier, 2003.
[2]
C. Babu and D. Janakiram. Method Driven Model: A Unified Model for an Object Composition Language. ACM SIGPLAN Notices, 39(8):61--71, 2004.
[3]
C. Babu, W. Jaques, and D. Janakiram. DynOCoLa: Enabling Dynamic Composition of Object Behaviour. In Proc. 2nd International Workshop on "Reflection, AOP and Meta-Data for Software Evolution (RAM-SE)" at ECOOP 2005, 2005.
[4]
L. Bettini, V. Bono, and S. Likavec. Safe and Flexible Objects with Subtyping. Journal of Object Technology, 10(4):5--29, December 2005. Special Issue: OOPS Track at SAC 2005.
[5]
L. Bettini, V. Bono, and B. Venneri. Object incompleteness and dynamic composition in Java-like languages. In TOOLS 2008, LNBIP. Springer, 2008. To appear.
[6]
L. Bettini, S. Capecchi, and E. Giachino. Featherweight Wrap Java. In Proc. of SAC 2007, Special Track on Object-Oriented Programming Languages and Systems (OOPS), pages 1094--1100. ACM Press, 2007.
[7]
V. Bono, M. Bugliesi, M. Dezani-Ciancaglini, and L. Liquori. A Subtyping for extensible, incomplete objects. Fundamenta Informaticae, 38(4):325--364, 1999.
[8]
G. Bracha. The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. PhD thesis, University of Utah, 1992.
[9]
C. Chambers. Object-Oriented Multi-Methods in Cecil. In Proc. of ECOOP, volume 615 of LNCS, pages 33--56. Springer, 1992.
[10]
D. Crawford. Communications of the ACM archive - Special Issue on Aspect-Oriented Programming, volume 44. ACM New York, 2001.
[11]
S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, and A. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems, 28(2):331--388, 2006.
[12]
E. Ernst, gbeta - a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Århus, Denmark, 1999. Url: http://www.daimi.au.dk/eernst/gbeta/.
[13]
K. Fisher, F. Honsell, and J. C. Mitchell. A lambda-calculus of objects and method specialization. Nordic J. of Computing, 1(1):3--37, 1994.
[14]
K. Fisher and J. C. Mitchell. A Delegation-based Object Calculus with Subtyping. In Proc. of FCT, volume 965 of LNCS, pages 42--61. Springer, 1995.
[15]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[16]
A. Goldberg and D. Robson. Smalltalk 80: The Language. Addison-Wesley, 1989.
[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, 2001.
[18]
G. Kniesel. Type-Safe Delegation for Run-Time Component Adaptation. In Proc. of ECOOP 99, volume 1628 of LNCS, pages 351--366. Springer, 1999.
[19]
S. Kochan. Programming in Objective-C 2.0. Addison-Wesley, 2nd edition, 2008.
[20]
H. Lieberman. Using prototypical objects to implement shared behavior in object oriented systems. ACM SIGPLAN Notices, 21(11):214--214, 1986.
[21]
B. C. Pierce. Types and Programming Languages. The MIT Press, Cambridge, MA, 2002.
[22]
J. Riecke and C. Stone. Privacy via Subsumption. Information and Computation, (172):2--28, 2002. 3rd special issue of Theory and Practice of Object-Oriented Systems (TAPOS).
[23]
A. J. Riel. Object-Oriented Design Heuristics. Addison-Wesley, 1996.
[24]
D. Ungar and R. B. Smith. Self: The power of simplicity. ACM SIGPLAN Notices, 22(12):227--242, 1987.
[25]
J. Viega, B. Tutt, and R. Behrends. Automated Delegation is a Viable Alternative to Multiple Inheritance in Class Based Languages. Technical Report CS-98-03, UVa Computer Science, 1998.

Cited By

View all
  • (2018)A core calculus for dynamic delta-oriented programmingActa Informatica10.1007/s00236-017-0293-655:4(269-307)Online publication date: 1-Jun-2018
  • (2009)A mechanism for flexible dynamic trait replacementProceedings of the 11th International Workshop on Formal Techniques for Java-like Programs10.1145/1557898.1557907(1-7)Online publication date: 6-Jul-2009
  • (2009)I-JavaProceedings of the 8th International Conference on Software Composition10.1007/978-3-642-02655-3_4(27-44)Online publication date: 30-Jun-2009

Index Terms

  1. Type safe dynamic object delegation in class-based languages

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PPPJ '08: Proceedings of the 6th international symposium on Principles and practice of programming in Java
    September 2008
    198 pages
    ISBN:9781605582238
    DOI:10.1145/1411732
    • Conference Chairs:
    • Luis Veiga,
    • Vasco Amaral
    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: 09 September 2008

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. delegation
    2. featherweight Java
    3. language extensions
    4. object composition

    Qualifiers

    • Research-article

    Conference

    PPPJ08
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 29 of 58 submissions, 50%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 07 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2018)A core calculus for dynamic delta-oriented programmingActa Informatica10.1007/s00236-017-0293-655:4(269-307)Online publication date: 1-Jun-2018
    • (2009)A mechanism for flexible dynamic trait replacementProceedings of the 11th International Workshop on Formal Techniques for Java-like Programs10.1145/1557898.1557907(1-7)Online publication date: 6-Jul-2009
    • (2009)I-JavaProceedings of the 8th International Conference on Software Composition10.1007/978-3-642-02655-3_4(27-44)Online publication date: 30-Jun-2009

    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