Section: New Results

Contracts and sessions

Participants : Ugo Dal Lago, Ornela Dardha, Maurizio Gabbrielli, Elena Giachino, Claudio Guidi, Jacopo Mauro, Fabrizio Montesi.

Contracts are descriptions of the functionalities offered by a component or a service, and of the way these functionalities may be accessed by clients. A contract may include a description of the component capabilities, place constraints on their usage, as well as declare preferences, entitlements and credentials. When a client wants to use one of the functionalities offered, it engages a dialogue (e.g., a sequence of interactions) with the servers; this is usually called a session.

The expected dialogue in a session can be specified by means of types, the session types.

We have studied [11] the integration of union and session types in a class-based language for building network applications, which amalgamates sessions and methods in order to flexibly exchange data according to communication protocols. We have established type safety properties guaranteeing that, after a session has started, computation cannot get stuck on a communication deadlock, and studied type inference. On a similar topic is the paper [23] .

We have used types [32] to guarantee bounds on sessions. These are polynomial bounds, on both time and space needed by the interacting processes to carry out the interactions in their sessions. This is the first example of a refinement of session types guaranteeing quantitative properties beyond the usual safety property, and builds on earlier work on soft linear logic.

In service-oriented architectures, the mechanism that allows to manage sessions and, in particular, to assign incoming messages to the correct sessions, is critical for efficiency and performance. A well-known solution to this problem, first introduced by BPEL, makes use of correlation sets. Intuitively these distinguish different sessions by means of the values for some specific variables which are present also in messages, thus allowing for their routing to sessions on the basis of these values. We have studied [36] a typed language for programming services based on correlation sets, that takes into account key aspects of service-oriented systems, such as distribution, loose coupling, open-endedness and integration. We have provided an implementation of the language as an extension of the Jolie language and applied it to a nontrivial real-world example of a fully-functional distributed user authentication system.

In current SOC languages based on correlation sets, a message can be assigned to a unique session. In another line of work on correlation sets [35] , we have studied the possibility – useful in many practical examples – of broadcasting messages to more than one session. We have investigated a data structure, based on radix trees, and an algorithm for managing a correlation mechanism, that support the broadcast primitive without degrading performances.