e70a6994c0e5626353545aa6c5b956f8.ppt
- Количество слайдов: 45
Bridging the gap between Interactionand Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi Zavattaro University of Bologna, Italy
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 2
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 3
Service Oriented Computing § A paradigm for programming distributed applications by combining services § Evolved from object-oriented and component computing § A service is a piece of code that can be § Dynamically found on the net based on its description § Invoked and integrated in a large application § Services are § Platform and language independent § Loosely coupled 4
Service Oriented Computing features § SOC applications can integrate services from different companies § Fundamental in business processing § SOC allows for great dynamicity and reusability § New versions of services immediately integrated in existing applications § Applications can be easily adapted to changing requirements § Based on international standards § § § SOAP for communication WSDL for describing service interfaces UDDI for describing service repositories BPEL for combining services … 5
Service choreography § Communication is the main aspect of SOC applications § Services interact via complex multiparty conversations § A service choreography is the description of the possible conversation patterns 6
Providing my ticket to Lisbon ask financing propose dates grant accept make available buy ticket req. payment pay deliver 7
Service choreography languages § § § We need languages to describe choreographies Two main approaches Interaction-Oriented Choreography: global description Process-Oriented Choreography: local description (Terminology not standardized yet) 8
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 9
Interaction-Oriented Choreography (IOC) § Describes the conversation from a global point of view § As composition of dat es P r opose interactions Carla ¡ ¡ ¡ ¡ ¡ ! Ivan § Specifies what should happen without saying how to do it § Easy to write and to understand § Difficult to implement § Good tool for design § At the basis of WS-CDL 10
IOC syntax I : : = j j j ! a ¡o b 1 0 I 1; I 2 I 1 k. I 2 I 1+ I 2 basic interaction empty IOC terminated IOC sequential composition parallel composition nondeterministic choice 11
Idea of IOC semantics § Semantics based on LTS p § Labels corresponding to basic interactions termination o o ! a ¡o b and p ¡ !1 !b ¡ !2 !c a b ! ! ! a ¡o 1 b; b ¡o 2 c ¡¡ ¡ ¡ 1 ¡! 0 ! ! a ¡o 1 b k c ¡o 2 p ¡o!2 !d ¡o!1 !b c a ! d ¡¡ ¡ ¡ a ¡o 1 b k 1 ¡¡ ¡ ¡ 1 k 1 ¡! 0 12
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 13
Process-Oriented Choreography (POC) § Describes each participant of the conversation (roles) § The behavior of each of them is described in terms of inputs and outputs (propose dat es; accept) I v an § § Difficult to understand what is going on Easy to implement Good starting point for implementation At the basis of BPEL 4 CHOR 14
POC syntax S : : = j (P ) a role S 1 k S 2 P : : = j j j o o 1 0 P 1 ; P 2 P 1 j. P 2 P 1 + P 2 parallel composition output input empty process terminated process sequential composition parallel composition nondeterministic choice 15
Idea of POC semantics § § Semantics based on LTS Two possible semantics Synchronous: output and input interact directly Asynchronous: the output spawns a message that is catched by the input 16
Idea of POC semantics § Semantics based on LTS § Two possible semantics § Synchronous: output and input interact directly !o a¡ b p § Labels corresponding to interaction p and termination !o b a¡ ! (o) a k (o) b ¡ ¡ ¡ (1) a k (1) b ¡! (0) a k (0) b § Asynchronous: the output spawns a message that is catched by the input 17
Idea of POC semantics § § Semantics based on LTS Two possible semantics Synchronous: output and input interact directly Asynchronous: the output spawns a message that is catched by the input o: a p § Labels corresponding to message spawning , interaction ! a ¡o b. and termination o: a ! (o) a k (o) b ¡¡ (1 jhoi ) a k (o) b p ! a ¡ !b o ¡¡ ¡ (1 j 1) a k (1) b ¡! (0) a k (0) b 18
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 19
From design to implementation § IOCs are good for design § POCs are more easily implementable § We want an automatic translation from IOCs to POCs § Should preserve the intended semantics § We project the IOC on each role to derive its behavior § We compose the behaviors of the different roles § We want the resulting POC to follow the IOC semantics 20
21
What ; means? § Consider the simple IOC o o a ¡ !1 b; c ¡ !2 d § In the synchronous case the (atomic) interaction between a and b should occur before the (atomic) interaction between c and d § In the asynchronous case there are different alternatives: § § Sender: the sending at a should occur before the sending at c Receive: the receive at b should occur before the receive at d Sender-receive: both of the above Disjoint: both the sending at a and the receive at b should occur before both the sending at c and the receive at d 22
A partial order Disjoint Sender - receiver Stricter constraints on IOC Receiver Sender Stronger relation on behaviors Synchronous 23
Projection § We consider a “natural” projection I proj(I ; a) § is the projection of IOC over role a § The projection is an homomorphism but for: ! proj(a ¡o b; a) = o ! proj(a ¡o b; b) = o ! proj(a ¡o b; c) = 1 § The resulting POC is the parallel composition of the projections on all the roles § We look for conditions ensuring that such a projection behaves well 24
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 25
Conditions for a correct projection § We want conditions ensuring that the projection behaves well § They will depend on the chosen semantics § We have three kinds of “connectedness” conditions § § For sequential composition For choice For operations used more than once (No condition for parallel composition) 26
Connectedness for sequence § Ensures the o correctness of sequential composition o a ¡ !1 b; c ¡ !2 d § § Synchronous: {a, b} ∩ {c, d} ≠ Ø Sender: a=c or b=c Receiver: b=c or b=d Disjoint: b=c § The conditions can. I be generalized to ensure the ; J connectedness of § Conditions should be applied to final transitions of J transitions of I and initial 27
Example § Consider: o ! a ¡ !1 b; a ¡o 2 d § The ; o ) k (o (o projection is: 1 2 a ) k (o 2 ) d 1 b § The POC behaves well for synchronous and sender semantics § The POC is not connected for receiver or disjoint semantics 28
Points of choice § I + J the correctness of choice Ensures § Synchronous: § The same role should occur in each initial transition § The roles in the two branches should be the same § Asynchronous: § The sender should be the same § The roles in the two branches should be the same 29
Points of choice: example § If we drop the condition on o roles: o o (a ¡ !1 b+ a ¡ !2 c); b ¡ !3 c § ((othe projection In + o ); 1) 1 2 a k ((o 1 + 1); o 3 ) b k ((1 + o 2 ); o 3 ) c § Interaction on O 3 is enabled 30
Causality-safety § Using many times the same operation may cause problems c ¡o d ! a ¡o b k ! § For instance a may interact with d (o) a k (o) b k (o) c k (o) d 31
Causality-safety § We define a causality relation between events of the projected POC § e 1 < e 2 if e 2 becomes enabled after e 1 has been performed § the exact definition depends on whether the semantics is synchronous or asynchronous § We require causality dependencies between events on the same operation § At most one of them can be enabled at each time § No interference 32
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 33
Bisimilarity § We characterize the behavioral relation between a IOC and the projected POC using (variations of) bisimilarity S 1 I 1 § A IOC ¡!® and a POC ¡!® are synchronous bisimilar iff I S I I S S 2 § If 1 then § Viceversa 1 2 and 2 are bisimilar § This is standard strong bisimilarity § Implies trace equivalence 34
Other bisimilarities § Sender bisimilarity: IOC transitions are matched by POC sends, POC receives are abstracted away § weak w. r. t. POC receive transitions § Receiver bisimilarity: IOC transitions are matched by POC receives, POC sends are abstracted away § weak w. r. t. POC send transitions § Disjoint bisimilarity: a IOC transition is matched by subsequent send and receive POC transitions 35
Main result § A IOC is bisimilar to its projection § According to the synchronous/sender/receiver/disjoint bisimilarity § If it satisfies all the synchronous/sender/receiver/disjoint connectedness conditions 36
Receive bisimulation example ¡o!1 !b ¡o!2 !b a c ! ! ! a ¡o 1 b; c ¡o 2 b ¡¡ ¡ ¡ 1 (o 1 ; 1) a k (o 1 ; o 2 ) b k (1; o 2 ) c (1; 1 jho 1 i ) a k (o 1 ; o 2 ) b k (1; o 2 ) c (1; 1 j 1) a k (1; o 2 ) b k (1 jho 2 i ) c 1! ¡o¡ : a o a ¡ !1 !b ¡¡ ¡ ¡ : c ¡o¡ 2 ! o c¡ !2 !b ¡¡ ¡ ¡ (1; 1 j 1) a k (1) b k (1 j 1) c 37
Receive bisimulation example (2) ¡o!1 !b ¡o!2 !b a c ! ! ! a ¡o 1 b; c ¡o 2 b ¡¡ ¡ ¡ 1 (o 1 ; 1) a k (o 1 ; o 2 ) b k (1; o 2 ) c (o 1 ; 1) a k (o 1 ; o 2 ) b k (1 jho 2 i ) c (1; 1 jho 1 i ) a k (o 1 ; o 2 ) b k (1 jho 2 i ) c (1; 1 j 1) a k (1; o 2 ) b k (1 jho 2 i ) c : c ¡o¡ 2 ! 1! ¡o¡ : a ¡o!1 !b a ¡¡ ¡ ¡ o c¡ !2 !b ¡¡ ¡ ¡ (1; 1 j 1) a k (1) b k (1 j 1) c 38
Roadmap § Choreography in SOC § The global view: IOC § The local view: POC § Projection from IOC to POC § Correctness conditions § Behavioral correspondence § Conclusions 39
Conclusion § We started from the basic question: which is the meaning of a IOC? § We derived different possible interpretations according to the choice of synchronous/asynchronous semantics and to the observable events § For each possibility § We found suitable syntactic conditions ensuring a correct projection § We characterized the behavioral relation between IOC and POC as a suitable bisimilarity relation 40
IOC simulations and POC simulations § (Bi)simulations can be defined both for IOCs and for POCs § Bisimulation between IOC and POC is compatible with those (bi)simulations § The projections of two (bi)similar IOCs are bisimilar § One can refine a IOC (e. g. , adding auxiliary interactions) and derive a refined POC § Refinement can solve connectedness problems 41
Language extensions § We want to extend theory to deal with § Internal located actions § Recursion § Hiding § Useful for refinement § Value passing can be added § A role should own the values it sends § Values can be used to transform nondetermistic choice into deterministic § Exceptions 42
Other possible developments § Look at smarter projection functions § Should allow to relax the connectedness conditions § May be related to refinement 43
44
Related work § Carbone, Honda, Yoshida, “Structured communicationcentred programming for web services”, ESOP ’ 07 § Honda, Yoshida, Carbone, “Multiparty asynchronous session types”, POPL ’ 08 § Bravetti, Zavattaro, “Towards a unifying theory for choreography conformance and contract compliance”, SC ’ 07 § Busi et al. , “Choreography and orchestration conformance for system design”, COORDINATION ’ 06 § Li, Zhu, Pu, “Conformance validation between choreography and orchestration”, TASE ‘ 07 45
e70a6994c0e5626353545aa6c5b956f8.ppt