This document discusses the dynamic synthesis of mediators to allow components with heterogeneous interfaces and behaviors to interact. It presents an approach that models component interfaces and behaviors, matches interfaces to find compatible functionality, generates correct-by-construction mediators, and concretizes mediators by translating data and coordinating middleware protocols. The goal is to overcome heterogeneity at the application and middleware layers through automated mediator synthesis.
Dynamic Synthesis of Mediators in Ubiquitous Environments
1. Dynamic Synthesis of Mediators
in Ubiquitous Environments
Amel Bennaceur
UPMC PhD Defense
work performed within the ARLES project-team
supervised by Valérie Issarny
2. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
Same functionality, various applications
• Heterogeneous Interfaces
2
How to represent files?
What kind of actions can be
performed on these files?
3. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
Same functionality, various applications
• Heterogeneous Interfaces
3
& Behaviours What is the order in which these
actions must be performed?
4. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
Same functionality, various applications
• Heterogeneous Interfaces
Diversity of middleware solutions
4
& Behaviours
What is the interaction protocol?
What is the message format?
HTTP/XML
SOAP/XML
REST/JSON
FTP/XML
REST/XML
5. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
5
FTP/XML
Same functionality, various applications
• Heterogeneous Interfaces
Diversity of middleware solutions
Ubiquity
& Behaviours
6. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
6
FTP/XML
Same functionality, various applications
• Heterogeneous Interfaces
Diversity of middleware solutions
Ubiquity
& Behaviours
Mediator
Mediator
Mediator
Mediator
7. Dynamic Synthesis of Mediators
18 July 2013
The Need for Dynamic
Synthesis of Mediators
7
Mediator
Same functionality, various applications
• Heterogeneous Interfaces
Diversity of middleware solutions
Ubiquity
& Behaviours
8. Dynamic Synthesis of Mediators
18 July 2013
Thesis Statement
Components with compatible functionalities
should be able to interact despite heterogeneities
in their interfaces and behaviors
at both application and middleware layers.
Mediators that seamlessly overcome these
heterogeneities should be dynamically
synthesised and deployed in their environment.
8
9. Dynamic Synthesis of Mediators
18 July 2013
9
Model of
WebDAV Client
Model of
Google Docs
Service
Domain ontology
Ressource
Document Folder
Thing
Nothing
SpreadSheetFile
Download Upload Delete
Replace
Move
Mediator
Dynamic Synthesis of
Mediators Informed by Ontologies
Model
Extraction
Model
Extraction
Synthesis
10. Dynamic Synthesis of Mediators
18 July 2013
Modelling Components
10
Background from Semantic Web Services
Ontology-based functional semantics
• Capability
• The high-level functionality of a system
• Interface
• A set of observable actions
LTS-based behavioural semantics
• The way the observable actions are
coordinated
Capability (CapWDAV)
Requires fileManagement
Interface signature (I WDAV)
Behaviour
<Authenticate, {Username, Password}, {Authorisation}>
<Lock, {SourceURI}, {Acknowledgment}>
<MoveFile, {SourceURI,DestinationURI}, {Acknowledgment}>
<ReadFile, {SourceURI}, {File}>
<Unlock, {SourceURI}, {Acknowledgment}>
...
Authenticate
Lock
MoveFile/ReadFile/WriteFile
Unlock
Logout
Behaviour (WDAV)
11. Dynamic Synthesis of Mediators
18 July 2013
Modelling Components
11
Background from Semantic Web Services
Ontology-based functional semantics
• Capability
• The high-level functionality of a system
• Interface
• A set of observable actions
LTS-based behavioural semantics
• The way the observable actions are
coordinated
• At both application and middleware layers
• Application → Business logic
• Middleware → Communication
& coordination protocol
Capability (CapWDAV)
Requires fileManagement
Interface signature (I WDAV)
Behaviour
<Authenticate, {Username, Password}, {Authorisation}>
<Lock, {SourceURI}, {Acknowledgment}>
<MoveFile, {SourceURI,DestinationURI}, {Acknowledgment}>
<ReadFile, {SourceURI}, {File}>
<Unlock, {SourceURI}, {Acknowledgment}>
...
Authenticate
Lock
MoveFile/ReadFile/WriteFile
Unlock
Logout
Behaviour (WDAV)
SendHTTPRequest[Authenticate]
[Username, Password]
ReceiveHTTPResponse[Authenticate]
[Authorisation]
12. Dynamic Synthesis of Mediators
18 July 2013
The Steps for
Dynamic Synthesis of Mediators
12
Interface Matching
Generating Correct-by-
Construction Mediators
Concretisation
Components’ interfaces
Components’ behaviours
Components’ communication
protocols
Overcoming the Heterogeneity of
Application
layer
Middleware
layer
many-to-many
under ambiguity
different interaction
paradigms
unified
approach
14. Dynamic Synthesis of Mediators
18 July 2013
Definition of Interface Matching
Matching interface to interface consists in finding all
pairs of actionssuch that a sequence of actions required by
the former can be safely performed using a sequence of
actions provided by the latter. In addition, all pairs are minimal.
But… interface matching computation is NP-Complete
14
Interface Matching
Generating Mediators
Concretisation
15. Dynamic Synthesis of Mediators
18 July 2013
Interface Matching using
Constraint Programming
15
CP Solver
Interface Matching
Generating Mediators
Concretisation
16. Dynamic Synthesis of Mediators
18 July 2013
Interface Matching using CP
Constraints: safety properties for
and
16
Interface Matching
Generating Mediators
Concretisation
The functionality offered by the provided actions covers that of
the required actions
Each required action has its output data available (also in the
appropriate format) at the time of execution, and
Each provided action has its input data available at the time of
execution.
17. Dynamic Synthesis of Mediators
18 July 2013
Interface Matching using
Constraint Programming
17
CP Solver
Interface Matching
Generating Mediators
Concretisation
18. Dynamic Synthesis of Mediators
18 July 2013
Ontology Encoding
But… No CP solver for ontological subsumption
Define a bit vector encoding of the ontology which is
correct and complete regarding the subsumption
and disjunction axioms.
18
Interface Matching
Generating Mediators
Concretisation
20. Dynamic Synthesis of Mediators
18 July 2013
From Interface Matching
to Matching Process
such that
20
… …
Associate a matching process
…
… … …
Interface Matching
Generating Mediators
Concretisation
21. Dynamic Synthesis of Mediators
18 July 2013
The Steps for
Dynamic Synthesis of Mediators
21
Interface Matching
Generating Correct-by-
Construction Mediators
Concretisation
Components’ interfaces
Components’ behaviours
Components’ communication
protocols
Overcoming the Heterogeneity of
Application
layer
Middleware
layer
many-to-many
under ambiguity
different interaction
paradigms
unified
approach
23. Dynamic Synthesis of Mediators
18 July 2013
Generating Correct-by-
Construction Mediators
The mediator composes the mapping processes in order to
allow both components, whose behaviours are
and , to coordinate and reach their final states
The basic case
Translation
23
Interface Matching
Generating Mediators
Concretisation
24. Dynamic Synthesis of Mediators
18 July 2013
Generating Correct-by-
Construction Mediators
24
X3
X#1
X#1
X2X2
P'1
P'2
P1
P2
M'
M
Interface Matching
Generating Mediators
Concretisation
X3
X#1
X#1
X2X2
P'1
P'2
P1
P2
M'
M
X3
X#1
X#1
X2X2
P'1
P'2
P1
P2
M'
M
25. Dynamic Synthesis of Mediators
18 July 2013
Mediator Synthesis
The mediator composes the mapping processes in order to
allow both components, whose behaviours are
and , to coordinate and reach their final states
The basic case
Translation
25
Interface Matching
Generating Mediators
Concretisation
26. Dynamic Synthesis of Mediators
18 July 2013
Mediator Synthesis
The mediator composes the mapping processes in
order to allow both components, whose behaviours are
and , to coordinate and reach their final states
Consumption of extra provided actions
26
P'1
P1
P2
M'
M
ββ
Interface Matching
Generating Mediators
Concretisation
27. Dynamic Synthesis of Mediators
18 July 2013
Mediator Synthesis
The mediator composes the mapping processes in
order to allow both components, whose behaviours are
and , to coordinate and reach their final states
Consumption of extra provided actions
27
Interface Matching
Generating Mediators
Concretisation
28. Dynamic Synthesis of Mediators
18 July 2013
The Steps for
Dynamic Synthesis of Mediators
28
Interface Matching
Generating Correct-by-
Construction Mediators
Concretisation
Components’ interfaces
Components’ behaviours
Components’ communication
protocols
Overcoming the Heterogeneity of
Application
layer
Middleware
layer
many-to-many
under ambiguity
different interaction
paradigms
unified
approach
29. Dynamic Synthesis of Mediators
18 July 2013
From Abstract to Concrete
Mediator
Refine the synthesised mediator
• Translating application data
• Combining ontology relations with schema
matching techniques
• Coordinating middleware protocols
• Deploying the mediator
29
Interface Matching
Generating Mediators
Concretisation
31. Dynamic Synthesis of Mediators
18 July 2013
Data Translations
31
Combine ontology relations with schema matching
techniques
• Subsumption:
Use schema matching tools to find, for each simple data concept in the target,
a corresponding data concept in the source
• Disjunction:
Select the appropriate translation function
such that
• Aggregation:
Use schema matching tools to find, for each simple data concept in the target,
a corresponding data concept in the concatenation of source schemas
Chapter 5. From Abstract to Concrete Mediators
ching to define the function f agg that specifies how the XML elements of
mputed using theXML elementsof Sagg. Hence, thetranslation function
osition of the two functions, i.e., f = f agg ◦ concat.
pplication to the File M anagement Example
32. Dynamic Synthesis of Mediators
18 July 2013
Coordinating middleware
Protocols- Example
32
ReceiveRequest[MoveFile][SourceURI,DestinationURI]
SendRequest [DownloadDocument][SourceURI]
SendReply[MoveFile][Acknowledgment]
ReceiveResponse [DownloadDocument][Document]
Concretise
DownloadDocument
UploadDocument
MoveFile
Compute Metadata and Content from DocumentDeleteDocument
SendRequest [UploadDocument][Metadata, Content,
DestinationURI]
…
Interface Matching
Generating Mediators
Concretisation
Compute SourceURI
33. Dynamic Synthesis of Mediators
18 July 2013
Interaction Patterns
33
Provided Action
Required Action
< op, i, a>
< op, i, a>
op = methodN ame
i = argument
a = returnValue
Server
Client
ReceiveRequest[methodN ame][argument]
ReceiveResponse[methodN ame][returnValue]
SendResponse[methodN ame][returnValue]
SendRequest[methodN ame][ar gument]
op = dataChannel
i = data
a = data
Writer
Reader
Write[data]
Read[dataChannel][data]
op = eventType
i = eventType
a = event
Publisher
Subscriber
Publish[event]
Subscribe[eventType]
GetEvent[event]
Unsubscribe
RPC DSM Publish/Subscribe
Interface Matching
Generating Mediators
Concretisation
34. Dynamic Synthesis of Mediators
18 July 2013
Deploying the Mediator
34
Translate req.lock into prov.setSharingPropertiers
Translate req.move into prov.downloadDoc followed by
prov.getUploadDoc followed by prov.getDeleteDoc
Translate req.unlock into prov.setSharingPropertiers
Control
HTTP Parser
HTTP Composer HTTP Parser
HTTP Composer
Mediator
Interface Matching
Generating Mediators
Concretisation
36. Dynamic Synthesis of Mediators
18 July 2013
Mediator Performance -
File Management
There is an overhead but response time for a request < 1s
36
0
200
400
600
800
1000
1200
1400
1600
1800
WebDAV/WebDAV GDocs/GDocs WebDAV/GDocs Gdocs/WebDAV
Timetoperformaninteraction(ms)
38. Dynamic Synthesis of Mediators
18 July 2013
Processing Time per Mediation Step
Depends on the size of the ontology
Depends on the type of mismatches
Negligible for real-world cases
38
39. Dynamic Synthesis of Mediators
18 July 2013
Conclusion - Contributions
Generating interface matching automatically
• Further dealing with one-to-many and many-to-many
correspondence
Synthesising correct-by-construction mediators
• Further dealing with ambiguity of interface matching
Dealing with differences at both application and
middleware layer
39
Dynamic Mediator Synthesis:
From Theory to Practice
41. Dynamic Synthesis of Mediators
18 July 2013
Towards the Next Generation of
Software
First Generation
• Execution
Second Generation
• Learning
Next Generation
• Innovation
41
43. Dynamic Synthesis of Mediators
18 July 2013
Further Information
Home page: amel.me
ARLES: www.rocq.inria.fr/arles
CONNECT: connect-forever.eu
Automated Mediator Synthesis: Combining Behavioural and Ontological
Reasoning, In Proc. SEFM 2013
The Role of Models@run.time in Supporting On-the-fly
Interoperability, Springer Computing 2013
Composing Distributed Systems: Overcoming the Interoperability
Challenge, FMCO 2012
The Role of Ontologies in Emergent Middleware: Supporting Interoperability
in Complex Distributed Systems, In Proc. Middleware 2011
Middleware-layer Connector Synthesis: Beyond State of the Art in
Middleware Interoperability, In SFM 2011
…
43
Editor's Notes
Consider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and
Consider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and
Various applications same functionalityDiversity of middleware solutionWhy is this work interesting for you, for me, and for othersConsider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and
Why is this work interesting for you, for me, and for othersConsider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and
Why is this work interesting for you, for me, and for othersConsider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and
Why is this work interesting for you, for me, and for othersConsider a file management system - it allows for reading, writing and sharing files- Many applications can be useMost of these applications are not standalone -> they are distributed across devicesDiscovered at runtime and