Advertisement

I-Java: An Extension of Java with Incomplete Objects and Object Composition

  • Lorenzo Bettini
  • Viviana Bono
  • Erica Turin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5634)

Abstract

Object composition is often advocated as a more flexible alternative to standard class inheritance since it takes place at run-time, thus permitting the behavior of objects to be specialized dynamically. In this paper we present I-Java, an extension of the Java language with a form of incomplete objects, i.e., objects with some missing methods which can be provided at run-time by composition with another (complete) object. Therefore, we can exploit object composition as a linguistic construct, instead of resorting to a manual implementation. This work builds on our theoretical model of incomplete objects, which was proved type-safe.

Keywords

Object-oriented programming Language extension Object composition Class-based languages Java 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Anderson, C., Barbanera, F., Dezani-Ciancaglini, M., Drossopoulou, S.: Can Addresses be Types (a case study: Objects with Delegation). In: WOOD 2003. ENTCS, vol. 82(8), pp. 1–22. Elsevier, Amsterdam (2003)Google Scholar
  2. 2.
    Babu, C., Janakiram, D.: Method Driven Model: A Unified Model for an Object Composition Language. ACM SIGPLAN Notices 39(8), 61–71 (2004)CrossRefGoogle Scholar
  3. 3.
    Babu, C., Jaques, W., Janakiram, D.: DynOCoLa: Enabling Dynamic Composition of Object Behaviour. In: Proc. of RAM-SE (2005)Google Scholar
  4. 4.
    Baldoni, M., Boella, G., van der Torre, L.W.N.: Interaction between Objects in powerJava. Journal of Object Technology 6(2) (2007)Google Scholar
  5. 5.
    Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Stateful traits. In: De Meuter, W. (ed.) ISC 2006. LNCS, vol. 4406, pp. 66–90. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  6. 6.
    Bettini, L., Bono, V.: Type Safe Dynamic Object Delegation in Class-based Languages. In: Proc. of PPPJ, pp. 171–180. ACM Press, New York (2008)CrossRefGoogle Scholar
  7. 7.
    Bettini, L., Bono, V., Naddeo, M.: A trait based re-engineering technique for Java hierarchies. In: Proc. of PPPJ, pp. 149–158. ACM Press, New York (2008)CrossRefGoogle Scholar
  8. 8.
    Bettini, L., Bono, V., Venneri, B.: Object incompleteness and dynamic composition in Java-like languages. In: Paige and Meyer [29], pp. 198–217Google Scholar
  9. 9.
    Bettini, L., Capecchi, S., Giachino, E.: Featherweight Wrap Java: wrapping objects and methods. Journal of Object Technology 7(2), 5–29 (2008)CrossRefGoogle Scholar
  10. 10.
    Bishop, J.: Language features meet design patterns: raising the abstraction bar. In: ROA 2008, pp. 1–7. ACM Press, New York (2008)Google Scholar
  11. 11.
    Bishop, J., Horspool, R.N.: On the Efficiency of Design Patterns Implemented in C# 3.0. In: Paige and Meyer [29], pp. 356–371Google Scholar
  12. 12.
    Chambers, C.: Object-Oriented Multi-Methods in Cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  13. 13.
    Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.: Traits: A mechanism for fine-grained reuse. ACM TOPLAS 28(2), 331–388 (2006)CrossRefGoogle Scholar
  14. 14.
    Ernst, E.: gbeta – a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Dep. of Computer Science, Univ. of Århus (1999)Google Scholar
  15. 15.
    Fisher, K., Mitchell, J.C.: A Delegation-based Object Calculus with Subtyping. In: Reichel, H. (ed.) FCT 1995. LNCS, vol. 965, pp. 42–61. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  16. 16.
    Florijn, G., Meijers, M., van Winsen, P.: Tool Support for Object-Oriented Patterns. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 472–495. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  17. 17.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)zbMATHGoogle Scholar
  18. 18.
    Guéhéneuc, Y.: Three Musketeers to the Rescue – Meta-Modeling, Logic Programming, and Explanation-based Constraint Programming for Pattern Description and Detection. In: Workshop on Declarative Meta-Programming at ASE 2002 (2002)Google Scholar
  19. 19.
    Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: Proc. of OOPSLA. ACM SIGPLAN Notices, vol. 37, pp. 161–173. ACM Press, New York (2002)Google Scholar
  20. 20.
    Herrmann, S.: A precise model for contextual roles: The programming language ObjectTeams/Java. Applied Ontology 2(2), 181–207 (2007)Google Scholar
  21. 21.
    Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001)CrossRefGoogle Scholar
  22. 22.
    Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  23. 23.
    Kniesel, G.: Type-Safe Delegation for Run-Time Component Adaptation. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 351–366. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  24. 24.
    Kristensen, B.B., Østerbye, K.: Roles: Conceptual abstraction theory and practical language issues. Theory and Practice of Object Sytems 2(3), 143–160 (1996)CrossRefGoogle Scholar
  25. 25.
    Kuhlemann, M., Apel, S., Rosenmüller, M., Lopez-Herrejon, R.E.: A Multiparadigm Study of Crosscutting Modularity in Design Patterns. In: Paige and Meyer [29], pp. 121–140Google Scholar
  26. 26.
    Lieberman, H.: Using prototypical objects to implement shared behavior in object oriented systems. ACM SIGPLAN Notices 21(11), 214 (1986)CrossRefGoogle Scholar
  27. 27.
    Lienhard, A., Ducasse, S., Arévalo, G.: Identifying traits with formal concept analysis. In: Proc. of ASE, pp. 66–75. IEEE, Los Alamitos (2005)Google Scholar
  28. 28.
    Nielsen, A.B., Ernst, E.: Optimizing Dynamic Class Composition in a Statically Typed Language. In: Paige and Meyer [29], pp. 161–177Google Scholar
  29. 29.
    Glowinski, R. (ed.): Proc. of TOOLS. LNBIP, vol. 11. Springer, Heidelberg (2008)Google Scholar
  30. 30.
    Pierce, B.C.: Types and Programming Languages. The MIT Press, Cambridge (2002)zbMATHGoogle Scholar
  31. 31.
    Riecke, J.G., Stone, C.: Privacy via Subsumption. Inf. and Computation (172), 2–28 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  32. 32.
    Steimann, F.: On the representation of roles in object-oriented and conceptual modelling. Data Knowledge Engineering 35(1), 83–106 (2000)CrossRefzbMATHGoogle Scholar
  33. 33.
    Ungar, D., Smith, R.B.: Self: The power of simplicity. ACM SIGPLAN Notices 22(12), 227–242 (1987)CrossRefGoogle Scholar
  34. 34.
    Viega, J., Tutt, B., Behrends, R.: Automated Delegation is a Viable Alternative to Multiple Inheritance in Class Based Languages. Technical Report CS-98-03 (1998)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Lorenzo Bettini
    • 1
  • Viviana Bono
    • 1
  • Erica Turin
    • 1
  1. 1.Dipartimento di InformaticaUniversità di TorinoTorinoItaly

Personalised recommendations