Composable Message Semantics in Object-Oriented Programming Languages


Dipl.-Ing. Markus A. Hof

Most object-oriented languages for distributed programming offer only a limited number of message semantics. An invocation semantic defines the mode in which a method is invoked, e.g. synchronous or asynchronous. At best, languages support a default mode of synchronous remote message passing, plus some keywords to express different styles of asynchronous messaging. The very few approaches that offer richer libraries of invocation abstractions, usually introduce a significant time overhead, lose - to some extent - transparency and/or do not support the composition of their abstractions.

This thesis describes a pragmatic approach - composable message semantics - for abstracting message passing semantics. Semantics, such as synchronous, asynchronous, transactional or replicated, are all considered first class citizens. Using an interesting combination of the Strategy and Decorator design patterns, we suggest an effective way to compose arbitrary new message semantics. We completely seperate a class definition from the message semantics used for invocations of its methods. We go a step further towards full polymorphism: the invocation of the same method can have different semantics on two objects of the same class. Invoking the very same method on a given object may even vary according to the client that performs the invocation. To reduce the overhead induced by the flexibility underlying our approach, we rely on a technique for just-in-time stub generation. This technique delays the generation of the necessary stub and skeleton code snippets until the last possible moment. By taking run-time knowledge into account, the code snippets are further optimised. They can also be adapted to the current execution environment.

The implementation of a prototypical distributed objects system shows the feasibility of our approach. We implemented this prototype in Oberon. Measurements prove that the increased overhead, due to the flexible message semantics, is only marginal. A number of realistic applications serve as a proof for the usability of our approach.

Betreuer: Prof. Dr. H. Mössenböck