skip to main content
10.1145/2093157.2093173acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Object reuse and behavior adaptation in Java-like languages

Published: 24 August 2011 Publication History

Abstract

Inheritance, which is a basic mechanism in mainstream object-oriented languages, introduces a strong coupling which limits modularity and code reuse. Furthermore, static class hierarchies cannot easily deal with unpredictable dynamic adaptations of the object behavior. In order to overcome these limitations, we propose new linguistic constructs for composing objects in a Java-like language. Objects are intended as featherweight components which can be used in multiple compositions, and object types specify not only the implemented functionalities, but also the required methods, which will be provided by other components during composition. Thus the language supports flexible object reuse and adaptation of the object behavior at run time. The static type discipline guarantees that method calls on well-typed object compositions are safe.

References

[1]
C. Babu and D. Janakiram. Method Driven Model: A Unified Model for an Object Composition Language. ACM SIGPLAN Notices, 39(8):61--71, 2004.
[2]
C. Babu, W. Jaques, and D. Janakiram. DynOCoLa: Enabling Dynamic Composition of Object Behaviour. In RAM-SE, 2005.
[3]
L. Bettini, V. Bono, and S. Likavec. Safe and Flexible Objects with Subtyping. Journal of Object Technology, 10(4):5--29, 2005.
[4]
L. Bettini, V. Bono, and E. Turin. I-Java: an extension of Java with incomplete objects and object composition. In Software Composition, volume 5634 of LNCS, pages 27--44. Springer, 2009.
[5]
L. Bettini, V. Bono, and B. Venneri. MoMi: a calculus for mobile mixins. Acta Informatica, 42(2--3):143--190, 2005.
[6]
L. Bettini, V. Bono, and B. Venneri. Delegation by object composition. Science of Computer Programming, 76(11):992--1014, 2011.
[7]
L. Bettini, S. Capecchi, and E. Giachino. Featherweight Wrap Java: wrapping objects and methods. Journal of Object Technology, 7(2):5--29, 2008.
[8]
J. Bishop. Language features meet design patterns: raising the abstraction bar. In ROA, pages 1--7. ACM, 2008.
[9]
J. Bishop and R. N. Horspool. On the Efficiency of Design Patterns Implemented in C# 3.0. In TOOLS, volume 11 of LNBIP, pages 356--371. Springer, 2008.
[10]
M. Büchi and W. Weck. Generic wrappers. In ECOOP, volume 1850 of LNCS, pages 201--225. Springer, 2000.
[11]
C. Chambers. Object-Oriented Multi-Methods in Cecil. In ECOOP, volume 615 of LNCS, pages 33--56. Springer, 1992.
[12]
D. Crawford. Communications of the ACM archive - Special Issue on Aspect-Oriented Programming, volume 44. ACM, 2001.
[13]
M. Dezani-Ciancaglini, D. Mostrous, N. Yoshida, and S. Drossopoulou. Session Types for Object-Oriented Languages. In ECOOP, volume 4067 of LNCS, pages 328--352. Springer, 2006.
[14]
S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, and A. Black. Traits: A mechanism for fine-grained reuse. ACM TOPLAS, 28(2):331--388, 2006.
[15]
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.
[16]
K. Fisher and J. C. Mitchell. A Delegation-based Object Calculus with Subtyping. In FCT, volume 965 of LNCS, pages 42--61. Springer, 1995.
[17]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[18]
W. Harrison, H. Ossher, and P. Tarr. Using Delegation for Software and Subject Composition. Technical Report RC 20946, IBM Thomas J. Watson Research Center, 1997.
[19]
S. Herrmann. A precise model for contextual roles: The programming language ObjectTeams/Java. Applied Ontology, 2(2):181--207, 2007.
[20]
S. S. Huang and Y. Smaragdakis. Expressive and safe static reflection with MorphJ. In PLDI, pages 79--89. ACM, 2008.
[21]
A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS, 23(3):396--450, 2001.
[22]
G. Kniesel. Type-Safe Delegation for Run-Time Component Adaptation. In ECOOP, volume 1628 of LNCS, pages 351--366. Springer, 1999.
[23]
B. B. Kristensen and K. Østerbye. Roles: Conceptual abstraction theory and practical language issues. Theory and Practice of Object Sytems, 2(3):143--160, 1996.
[24]
H. Lieberman. Using prototypical objects to implement shared behavior in object oriented systems. ACM SIGPLAN Notices, 21(11):214--214, 1986.
[25]
A. B. Nielsen and E. Ernst. Optimizing Dynamic Class Composition in a Statically Typed Language. In TOOLS, volume 11 of LNBIP, pages 161--177. Springer, 2008.
[26]
K. Ostermann. Dynamically composable collaborations with delegation layers. In ECOOP, volume 2374 of LNCS, pages 89--110. Springer, 2002.
[27]
K. Ostermann and M. Mezini. Object-Oriented Composition Untangled. In OOPSLA, pages 283--299. ACM, 2001.
[28]
J. Riecke and C. Stone. Privacy via Subsumption. Information and Computation, 172:2--28, 2002.
[29]
A. Taivalsaari. On the notion of inheritance. ACM Computing Surveys, 28(3):438--479, Sept. 1996.
[30]
D. Ungar and R. B. Smith. Self: The power of simplicity. ACM SIGPLAN Notices, 22(12):227--242, 1987.
[31]
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.
[32]
M. Zenger. Type-Safe Prototype-Based Component Evolution. In ECOOP, volume 2374 of LNCS, pages 470--497. Springer, 2002.

Cited By

View all
  • (2012)Modeling adaptation with KlaimACM SIGAPP Applied Computing Review10.1145/2432546.243254812:4(21-35)Online publication date: 1-Dec-2012
  • (2012)Modeling adaptation with a tuple-based coordination languageProceedings of the 27th Annual ACM Symposium on Applied Computing10.1145/2245276.2232019(1522-1527)Online publication date: 26-Mar-2012

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPPJ '11: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
August 2011
186 pages
ISBN:9781450309356
DOI:10.1145/2093157
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

  • DTU: Technical University of Denmark
  • ORACLE: ORACLE

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 August 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. delegation
  2. featherweight Java
  3. object composition
  4. type systems

Qualifiers

  • Research-article

Funding Sources

Conference

PPPJ '11
Sponsor:
  • DTU
  • ORACLE
PPPJ '11: Principles and Practice of Programming in Java
August 24 - 26, 2011
Kongens Lyngby, Denmark

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2012)Modeling adaptation with KlaimACM SIGAPP Applied Computing Review10.1145/2432546.243254812:4(21-35)Online publication date: 1-Dec-2012
  • (2012)Modeling adaptation with a tuple-based coordination languageProceedings of the 27th Annual ACM Symposium on Applied Computing10.1145/2245276.2232019(1522-1527)Online publication date: 26-Mar-2012

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