Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

How to model a composition?

Executable Modeling of Software Architectures

the case of Service Composition

Cesare Pautasso
University of Lugano, Switzerland
[email protected]

14 December 2012

University of Lugano (USI)

Faculty of Informatics

Programming in the Large

Programming in the Small

Gio Wiederhold, Peter Wegner, Stefano Ceri, CACM, 35(11):89-99, Nov. 1992

Model the architecture of a software composition

Component Abstractions

Component vs. Service

Top Down: Decomposition

  1. Define a goal and sketch a skeleton of a composition
  2. Refine it by binding components into it:
    • Search for existing components
    • Build missing components
    • Add glue (e.g., data transformations)
  3. Run, test and debug the composition within the original modeling environment
  4. Share and publish it as a reusable component

Bottom up: Recomposition

  1. Share and publish it as a reusable component
  2. Run, test and debug the composition within the original modeling environment
  3. Build a composition model
  4. Select components from a library:
    • Web services and Web resources
    • Local components
    • Glue components

Iterative Composition

1 Tool

1 Click

1? Language

How to model a composition?

Which primitives?

Which connectors?

Which syntax?

Which syntax?

Which syntax?

The choice of the syntax depends on the purpose and the user of the meta-model

The challenge of executable modeling does not lie in transforming models between different representations, but in enabling testing and debugging of an executable model within the representation it was originally specified with

Unit of composition

Model any kind of service invocation

Data Flow Interface

Input, Output parameters

Control Flow

Dependencies triggered by task state changes (Finished, Failed, Aborted)

Cycles allowed
Arbitrary synchronization rules possible

Technology Adapter

Mapping to service invocation mechanism and connector (configured by developer)

Natural Language Description

Abstract textual description for the end user

Simple Example

Show 10 Italian restaurants near zip 76092 on the map.

Composition Model: Views

  1. Component Bindings
  2. Control Flow
  3. Data Flow

Component Bindings

Control Flow

Data Flow

Less simple Examples

Control Flow

Vote to choose a meeting place based on its geographic location





The S Scripting Language

for Scalable, Stateful, RESTful Services

S: Hello World

service S { 
  res '/hello' on GET { 
  //handle GET request
    respond 'World!'; 

Request handlers contain any JavaScript code (with some S extensions)

S: Proxy

service Proxy { 
  res '/hello1' on GET { 
    respond get '/hello2'; 
  res '/hello2' on GET { 
    respond get ''; 

S: Composition

service Composition { 
  res '/search' on GET { 
    res a = '$query';
    res b = '$query';
    respond a.get + b.get; 

S: Composition

service YahooLocalMap { 
  res '/ylm' on GET { 
    res yls = '' + 
    var local = yls.get;
    respond render('GoogleMap', local); 

S: Stateful Services

service Stateful { 
 res '/hello' {
  state s = 'World'
  on GET { 
    respond 'Hello ' + s
  on PUT { 
   s = $name

S: DoodleMap

service DoodleMap { 
 res '/doodlemap' {
  state i = 0;
  state ui_html = [];
  on POST { 
res yls = '' + '?query=$query&zip=$zip'; res doodle = ''
var local = yls.get; var pollurl =,$title));
ui_html[i++] = render('GoogleMap', local, pollurl); res '/:id' { on GET { respond ui_html[$id]; } }
respond { 302: {"Location": "/doodlemap/" + i}} var timer = setInterval(function() { var pollState = res(pollurl).get; var participants = countParticipants(pollState); if (participants == $maxParticipants) { res(pollurl).put("closed"); clearInterval(timer); } },1000); } } }


Executable Modeling

Modeling and Services



Use a spacebar or arrow keys to navigate