Flexible Type-Safe Linking of Components for Java-Like Languages
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.
KeywordsComposition Operator Reduction Rule Type Constraint Binary Component Class Node
Unable to display preview. Download preview PDF.
- 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.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.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
- 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.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
- 11.Buckley, A., Drossopoulou, S.: Flexible Dynamic Linking. In: 6th Intl. Workshop on Formal Techniques for Java Programs 2004 (June 2004)Google Scholar
- 12.Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)Google Scholar
- 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
- 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.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
- 20.Szyperski, C.: Component Software: Beyond Object-Oriented Programming, 2nd edn. Addison-Wesley, Reading (2002)Google Scholar