Flexible Type-Safe Linking of Components for Java-Like Languages

  • Davide Ancona
  • Giovanni Lagorio
  • Elena Zucca
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4228)


We define a framework of components based on Java-like languages, where components are binary mixin modules. Basic components can be obtained from a collection of classes by compiling such classes in isolation; for allowing that, requirements in the form of type constraints are associated with each class. Requirements are specified by the user who, however, is assisted by the compiler which can generate missing constraints essential to guarantee type safety.

Basic components can be composed together by using a set of expressive typed operators; thanks to soundness results, such a composition is always type safe.

The framework is designed as a separate layer which can be instantiated on top of any Java-like language; a prototype implementation is available for a small Java subset.

Besides safety, the approach achieves great flexibility in reusing components for two reasons: (1) type constraints generated for a single component exactly capture all possible contexts where it can be safely used; (2) composition of components is not limited to conventional linking, but is achieved by means of a set of powerful operators typical of mixin modules.


Composition Operator Reduction Rule Type Constraint Binary Component Class Node 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aldrich, J., Chambers, C., Notkin, D.: Architectural reasoning in ArchJava. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 334–367. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  2. 2.
    Ancona, D., Damiani, F., Drossopoulou, S., Zucca, E.: Polymorphic bytecode: Compositional compilation for Java-like languages. In: ACM Symp. on Principles of Programming Languages 2005. ACM Press, New York (2005)Google Scholar
  3. 3.
    Ancona, D., Lagorio, G., Zucca, E.: Smart modules for Java-like languages. In: 7th Intl. Workshop on Formal Techniques for Java-like Programs 2005 (July 2005)Google Scholar
  4. 4.
    Ancona, D., Lagorio, G., Zucca, E.: A flexible and type-safe framework of components for Java-like languages. Technical report, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova (submitted for journal publication, 2006)Google Scholar
  5. 5.
    Ancona, D., Zucca, E.: True modules for Java-like languages. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 354–380. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  6. 6.
    Ancona, D., Zucca, E.: A calculus of module systems. Journ. of Functional Programming 12(2), 91–132 (2002)MATHMathSciNetGoogle Scholar
  7. 7.
    Bracha, G.: The Programming Language JIGSAW: Mixins, Modularity and Multiple Inheritance. Ph.D thesis, Department of Comp. Sci., Univ. of Utah (1992)Google Scholar
  8. 8.
    Bracha, G., Odersky, M., Stoutmire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the Java programming language. In: ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1998, pp. 183–200. ACM Press, New York (1998)Google Scholar
  9. 9.
    Bruce, K.B., Foster, J.N.: LOOJ: Weaving LOOM into Java. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 390–414. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Bruce, K.B., Odersky, M., Wadler, P.: A statically safe alternative to virtual types. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 523–549. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  11. 11.
    Buckley, A., Drossopoulou, S.: Flexible Dynamic Linking. In: 6th Intl. Workshop on Formal Techniques for Java Programs 2004 (June 2004)Google Scholar
  12. 12.
    Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)Google Scholar
  13. 13.
    Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: Intl. Conf. on Functional Programming 1998 (September 1998)Google Scholar
  14. 14.
    Hirschowitz, T., Leroy, X.: Mixin Modules in a Call-by-Value Setting. In: Le Métayer, D. (ed.) ESOP 2002 and ETAPS 2002. LNCS, vol. 2305, pp. 6–20. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  15. 15.
    Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)CrossRefGoogle Scholar
  16. 16.
    Lagorio, G.: Dynamic linking of polymorphic bytecode. In: 8th Intl. Workshop on Formal Techniques for Java-like Programs 2005 (July 2006)Google Scholar
  17. 17.
    McDirmid, S., Flatt, M., Hsieh, W.: Jiazzi: New age components for old fashioned Java. In: ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2001). ACM Press, New York (2001)Google Scholar
  18. 18.
    Costa Seco, J., Caires, L.: A Basic Model of Typed Components. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, pp. 108–128. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  19. 19.
    Sreedhar, V.C.: Mixin’up components. In: Proceedings of the 22rd International Conference on Software Engineering, ICSE 2002, pp. 198–207. ACM Press, New York (2002)CrossRefGoogle Scholar
  20. 20.
    Szyperski, C.: Component Software: Beyond Object-Oriented Programming, 2nd edn. Addison-Wesley, Reading (2002)Google Scholar
  21. 21.
    Torgersen, M.: The expression problem revisited. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 123–143. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  22. 22.
    Zenger, M.: Type-safe prototype-based component evolution. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 470–497. Springer, Heidelberg (2002)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Davide Ancona
    • 1
  • Giovanni Lagorio
    • 1
  • Elena Zucca
    • 1
  1. 1.DISI, Univ. of GenovaGenovaItaly

Personalised recommendations