choreography projection and contract refinement
play

Choreography Projection and Contract Refinement Mario Bravetti - PowerPoint PPT Presentation

Choreography Projection and Contract Refinement Mario Bravetti Department of Computer Science http://cs.unibo.it/~bravetti University of Bologna INRIA research team FOCUS Joint work with: Ivan Lanese, Gianluigi Zavattaro Plan of the Plan


  1. Choreography Projection and Contract Refinement Mario Bravetti Department of Computer Science http://cs.unibo.it/~bravetti University of Bologna INRIA research team FOCUS Joint work with: Ivan Lanese, Gianluigi Zavattaro

  2. Plan of the Plan of the Talk � Global and Local Choreography � Contract+based service discovery � A dynamic update mechanism � Conclusion

  3. Web Service Choreography Description Language � Describe the interaction among the combined services from a top abstract view Choreography Orchestration (e.g. WS-CDL) (e.g. WS-BPEL) Top abstract view One Party detailed of whole system: view of the system each action is a that orchestrates a communication part of it by sending involving two of (to other parties) & its participants receiving messages

  4. Similar to UML Sequence Diagrams

  5. WS+CDL � Global view of service interactions Seller Buyer Bank

  6. WS+CDL � Global view of service interactions Seller Request Request Buyer Bank

  7. WS+CDL � Global view of service interactions Seller Request Request Offer Buyer PayDescr Bank

  8. WS+CDL � Global view of service interactions Seller Request Request Offer Buyer PayDescr Payment Bank

  9. WS+CDL � Global view of service interactions Seller Request Request Offer Buyer PayDescr Confirm Payment Receipt Bank

  10. WS+CDL Request Buyer � Seller ; ( Offer Seller � Buyer | PayDescr Seller � Bank ) ; PayDescr Seller � Bank ) ; Payment Buyer � Bank ; ( Confirm Bank � Seller | Receipt Bank � Buyer )

  11. Projection of the Choreography on the Single Participants Buyer: Invoke(Request)@Seller;Receive(Offer); Invoke(Payment)@Bank;Receive(Receipt) Seller: Receive(Request); (Invoke(Offer)@Buyer | (Invoke(Offer)@Buyer | Invoke(PayDescr)@Bank); Receive(Confirm) Bank: Receive(PayDescr);Receive(Payment); (Invoke(Receipt)@Buyer | Invoke(Confirm)@Seller)

  12. Well Formed WS+CDL specifications � Can we always project a WS+CDL specification in an equivalent one? � Which kind of equivalences are � Which kind of equivalences are preserved?

  13. A Formal Model for WS+CDL � A global choreography language: H ::= a r � � s | 1 | 0 | � � H;H | H+H | H|H | H* H;H | H+H | H|H | H*

  14. A Formal Model for WS+CDL � A global choreography language: H ::= a r � � s | 1 | 0 | � � H;H | H+H | H|H | H* H;H | H+H | H|H | H* r invokes the operation a of s Unsuccessful Successful termination termination

  15. A Formal Model for WS+CDL � A global choreography language: H ::= a r � � s | 1 | 0 | � � H;H | H+H | H|H | H* H;H | H+H | H|H | H* Sequence Choice Parallel Repetition

  16. A Formal Model for orchestrations � A language for orchestrations: P ::= a | a r | 1 | 0 | P;P | P+P | P|P | P* P;P | P+P | P|P | P* S ::= [P] r | S|S

  17. A Formal Model for orchestrations � A language for orchestrations: P ::= a | a r | 1 | 0 | P;P | P+P | P|P | P* P;P | P+P | P|P | P* S ::= [P] r | S|S Unsuccessful receive on a termination Successful invoke a at r termination

  18. A Formal Model for orchestrations � A language for orchestrations: P ::= a | a r | 1 | 0 | P;P | P+P | P|P | P* P;P | P+P | P|P | P* S ::= [P] r | S|S Sequence Choice Parallel Repetition

  19. A Formal Model for orchestrations � A language for orchestrations: P ::= a | a r | 1 | 0 | P;P | P+P | P|P | P* P;P | P+P | P|P | P* S ::= [P] r | S|S Parallel composition Behaviour of of participants participant r

  20. The “canonical” projection � Projection [[ H ]] t of choreography H to participant t a s if t=r [[ a [[ a r � � s ]] t ]] = = a a if t=s if t=s � � 1 otherwise [[H;H’]] t =[[H]] t ; [[H’]] t [[H|H’]] t =[[H]] t | [[H’]] t [[H+H’]] t =[[H]] t + [[H’]] t [[H*]] t =[[H]] t *

  21. Example � Consider the global choreography: a r � � s ; b t � � � � � � u � Projection: � Projection: [ a s ;1] r | [ a;1 ] s | [ 1;b u ] t | [ 1;b ] u � Are the two choreographies equivalent? � NO � But, if r=t…. YES [ a s ; b u ] r | [ a;1 ] s | [ 1;b ] u

  22. Asynchronous communication � Reconsider the example assuming asynchronous communication [ a s ; b u ] r | [ a ] s | [ b ] u [ a s ; b u ] r | [ a ] s | [ b ] u � Communication on a starts before communication on b but could finish after � What we should observe? � Send, Receive, both, …?

  23. A lattice of possible observation criteria Synchronous Sender Sender Receiver Receiver Sender+receiver

  24. A lattice of possible observation criteria Assuming synchronous communication: Synchronous observe either send or receive Sender Sender Receiver Receiver Sender+receiver

  25. A lattice of possible observation criteria Synchronous Sender Sender Receiver Receiver Assuming asynchronous Sender+receiver communication: observe send

  26. A lattice of possible observation criteria Synchronous Sender Sender Receiver Receiver Assuming asynchronous Sender+receiver communication: observe receive

  27. A lattice of possible observation criteria Synchronous Sender Sender Receiver Receiver Assuming asynchronous Sender+receiver communication: observe send and observe receive

  28. What about the previous example? � Reconsider the example a r � � s ; b r � � � � � u � [ a s ; b u ] r | [ a ] s | [ b ] u [ a s ; b u ] r | [ a ] s | [ b ] u � OK: for synchronous and sender � NO: for receiver, sender+receiver

  29. Main results � For each observation criterion: � Sufficient conditions (connectedness, unique point of choice, and causality safe) that guarantee that a global choreography that guarantee that a global choreography is equivalent to the projected one

  30. Unique point of choice � In a choice H+H’ � The sender of the initial transitions in H and in H’ is always the same � The roles in H and in H’ are the same � Example: if we drop the second condition (a r � � s + b r � � t ); c s � � t � � � � � � [ ( a s +b t );1] r | [ (a+1);c t ] s | [ (1+b);c ] t

  31. Which equivalence between global and local choreographies? � Synchronous equivalence: global transitions are matched by synchronous local transitions � Sender equivalence: global transitions are matched by local sends, local receives are abstracted away by local sends, local receives are abstracted away � weak w.r.t. local receive transitions � Receiver equivalence: global transitions are matched by local receives, global sends are abstracted away � weak w.r.t. local send transitions � Sender+Receiver equivalence: both conditions above

  32. Example: Receiver equivalence � Global choreography: a r � � s ; b t � � � � � � s � Local choreography: � Local choreography: [ a s ] r | [ a;b ] s | [ b s ] t � The two systems are receiver equivalent

  33. Plan of the Plan of the Talk � Global and Local Choreography � Contract+based service discovery � A dynamic update mechanism � Conclusion

  34. Contracts � Contract: service “behavioural interface” � correct sequences public registry of invoke and receive Contract: Contract: � as in an orchestration abstract service (role of a coreography) description � just finite+state labeled transition systems with successful termination Service

  35. Contract Compliance � Verification of correctness of service composition based on their contracts: successful interaction i.e. no deadlock / termination reached public registry public registry Contract: Contract: … abstract service abstract service description description Reciprocal invocations … Service Service

  36. Service Compliance: Formally � Services are compliant if the following holds for their composition P : τ τ P --->* P’ P --->* P’ implies that there exist P’’ and P’’’ s.t. τ √ P’ --->* P’’ ---> P’’’ � i.e. every computation can be extended to reach successful completion of all services � termination under fairness assumption

  37. Example: compliant services � The following pairs of services are compliant: � C 1 = a+b+c C 1 = a+b+c C 2 = a + b C 2 = a + b � C 1 = a;b C 2 = a | b � C 1 = (a; b )* C 2 = a;( b;a )*;b

  38. Compliance+Preserving Contract Refinement ! Choreography projection projection compliant by construction Contract Part. 1 Contract Part. n … refines refines compliance public registry public registry preserved by refinement … Contract Contract Reciprocal invocations … Service Service

  39. Contract Refinement Relation Choreography compliant by construction Contract Part. 1 Contract Part. n … refines refines compliance public registry public registry preserved by refinement … Contract Contract Reciprocal invocations … Service Service

  40. Formally: Subcontract Preorder � Preorder ≤ between contracts C : � C’ ≤ C means C’ is a subcontract of C C C subcontract preorder sub-contracts of C

  41. Definition of Preorder Induced from Independent Refinement Given a set of compliant contracts … C 1 C 2 C n subcontract preorder preorder sub-contracts sub-contracts sub-contracts … of C n of C 1 of C 2 … C’ 1 C’ 2 C’ n is a set of compliant contracts

Recommend


More recommend