ComponentGlue

Microsoft Research Grant 2002-73

May, 2002

Although the general concept of ``software component'' seems close to the familiar notion of (first-class) module, and extensive efforts have been placed on the development of sophisticated module systems for (mainly functional) programming languages (see [1]), the need to address the particular requirements of modern component-based systems is now becoming more evident, due to the widespread availability of platforms providing runtime support for ``components'', for instance, the JVM and the Microsoft .NET CLR.

We find that most industrial programming languages provide useful modularization and composition constructs (classes and inheritance) for programming the internals of components, but fail to provide adequate support for component-oriented programming, e.g., do not enforce the separation of architectural from functional aspects, do not support type-safe composition of (first-class) components, and do not ensure consistency of dynamic compositions.

State-of-the-art component software is mostly based on object aggregation, relying on the carefully assembly of networks of references to implement the intended architecture. Such an approach still place on the programmer the heavy burden of manually ensuring the preservation of architectural properties that could well be mechanically verified by a type system, provided that types are given to type components and not only objects. For instance, such type information for components should include ``required interfaces'', and not only ``provided interfaces'' as in .NET assemblies and Java classes.

In ongoing work, we are studying specific language level abstractions for component programming. In [2,3] we developed a simple programming model that capture some basic ingredients (explicit context dependence, dynamic binding and subtype polymorphism at the level of both components and objects, late composition, and avoidance of inheritance in favor of composition) which are believed to be central to black-box object-oriented component programming styles. Our model is expressed formally by a core calculus, in which components are first-class entities. Basic constructs enable the composition, scripting, instantiation and definition of atomic components. The calculus type system assigns types to both components and objects, and ensures runtime safety of composition.

More recently, we started to explore the application of our model to the design of a typed ``glue'' language for component programming. Our aim is to produce a really useful composition language, able to interoperate with (black-box) components written in several candidate programming languages (C#, Java), while ensuring interesting safety properties of dynamic composition at compile time. We intend that such a composition language may play the role of a type safe ``make utility'' with some scripting abilities, and callable from within applications. We have already obtained some preliminary results on this direction, namely implemented a prototype compiler for a version of the glue language for type-parametric (generic) first-class components.

Currently, our system is targeted to the JVM, an early choice made in order to have a degree of interoperatibility. However, the bias of the JVM towards the Java language induces some implementation difficulties, due to the strictness of the underlying Java type system, for instance, when translating parametric polymorphism and handling structural type equivalence. We believe that retargeting our current compiler towards the .NET CLR is a quite promising project, since it will hopefully benefit from several relevant features of the platform, namely its language-independence, the native support provided for delegates, boxing, and its extensible type system.

Publications


Bibliography

1
B. C. Pierce.
Advanced Module Systems (A guide for the perplexed).
pdf slides in Pierce's web site, 1999.

2
J. C. Seco and L. Caires.
A basic model of typed components.
In Elisa Bertino, editor, ECOOP'2000 14th European Conference on Object-Oriented Programming, volume 1850 of Lecture Notes in Computer Science, 2000.

3
J. C. Seco and L. Caires.
Parametrically typed components.
In W. Weck J. Bosch, C. Szyperski, editor, Proceedings of WCOP'2000, Research Report 2000:15 Blekinge Institute of Technology, 2000.