View
3
Download
0
Category
Preview:
Citation preview
Web Service Interfaces
Dirk BeyerArindam ChakrabartiThomas A. Henzinger
2006-06-27 LORIA, Nancy, France 2
Buying a Book
Amazon
FedEx
Springer
VISA
BofA
2006-06-27 LORIA, Nancy, France 3
Stand-alone software development scenario
Specification Write Code Compile/Build Test
2006-06-27 LORIA, Nancy, France 4
Web software development scenario
Amazon
FedEx
Springer
VISA
BofA
Specification Write Code Compile/Build Test
2006-06-27 LORIA, Nancy, France 5
Web Service Interfaces
• Web methods: m ∈ M• Namespace: N ⊆ M• Instances: i• Actions: <m,i>
2006-06-27 LORIA, Nancy, France 6
Actions
<SellItem, SOLD>
<ChkAvail,OK>
2006-06-27 LORIA, Nancy, France 7
Web Service Interfaces
We provide three of them:- Signature interfaces- Consistency interfaces- Protocol interfaces
2006-06-27 LORIA, Nancy, France 8
Signature Interfaces
Action a is mapped to the set of actions that may be directly invoked when a occurs.
<SellItem, sold> → { <ChkAvail, ok>, <ProcPay, ok> }
2006-06-27 LORIA, Nancy, France 9
Supported and Required Actions
<m1,i1> → { <m2,i2>, <m3,i3>}
<m1,i1> is supported (guaranteed).<m2,i2> and <m3,i3> are required (assumed).
Required actions outside interface namespace are supported by the environment.
2006-06-27 LORIA, Nancy, France 10
Compatibility and Composition
Two signature interfaces are compatible if their namespaces do not clash.
The composition is obtained by taking the union (of the namespaces and mapping functions).
2006-06-27 LORIA, Nancy, France 11
Refinement
<m1,i1> → { <m2,i2>, <m3,i3>, <m4,i4> }
<m1,i1> → { <m2,i2>, <m3,i3> }<m2,i2> → { <m4,i4> }
The refinement must not have a larger namespace.<
2006-06-27 LORIA, Nancy, France 12
Refinement
Bank’
Bank
4
2006-06-27 LORIA, Nancy, France 13
Consistency Interfaces
2006-06-27 LORIA, Nancy, France 14
Consistency Interfaces
Consistency Interface = Signature Interface + Choice
An action is mapped to a set of conversations,where conversation is a set of actions exhibited together (in some sequence).
2006-06-27 LORIA, Nancy, France 15
Supply Chain Management Application
2006-06-27 LORIA, Nancy, France 16
Supply Chain Management Application
<SellItem, FAIL>
<ShipItem, FAIL>
<ProcPay, OK><ProcPay, FAIL>
<ChkAvail, OK><ChkAvail, FAIL>
∨
∨
Each path in the tree generates a conversation.
2006-06-27 LORIA, Nancy, France 17
Compatibility and Composition
• Consistency interfaces have underlyingsignature interfaces.
• Two consistency interfaces are compatible if their underlying signature interfaces are.
• The composition is given by union (of namespaces and mapping functions).
2006-06-27 LORIA, Nancy, France 18
Refinement
<m1,i1> → {{<m2,i2>, <m4,i4>} ∨ {<m3,i3>} }
<m1,i1> → {{<m2,i2>} ∨ {<m3,i3>}}<m2,i2> → { {<m4,i4>} }
The refinement must not have a larger namespace.<
2006-06-27 LORIA, Nancy, France 19
Specifications
Specifications are used to capture additional behavioral properties of interest to the designer.
<SellItem,FAIL> Ã{<ChkStore,FAIL>, <ProcPay,OK>}
The customer should not be charged if the item was not in store.
2006-06-27 LORIA, Nancy, France 20
Compositional Refinement
C1 C2
C’1
compatible
<
If
2006-06-27 LORIA, Nancy, France 21
Compositional Refinement
C1 C2
C’1
Then
compatible
and (C’1 + C2) 4 (C1 + C2)
2006-06-27 LORIA, Nancy, France 22
Refinement Preserves Specifications
If C ² φ, then for all C’ such that C’ 4 C, we have C’ ² φ.
2006-06-27 LORIA, Nancy, France 23
Existence of Environment
C ² φ if and only if there exists an environment E of C, such that (C + E) ² φ.
If C1 and C’1 and C2 are such that C’1 4 C1, and C1 is compatible with C2, then for any specification φ if (C1 + C2) ² φ then (C’1 + C2) ² φ.
2006-06-27 LORIA, Nancy, France 24
Protocol Interfaces
2006-06-27 LORIA, Nancy, France 25
Protocol Interfaces
Protocol Interface = Consistency Interface + Temporal sequencing information for action invocations.
An action is mapped to a set of recursive finite state machines with transitions labeled with sets of actions.
2006-06-27 LORIA, Nancy, France 26
Supply Chain Management Application
<ChkStore, FAIL>
<Sup2.Order, OK><Sup1.Order, OK>
<Sup2.GetOffer, OFR><Sup1.GetOffer, OFR>
k
∨
2006-06-27 LORIA, Nancy, France 27
Compatibility and Composition
• Protocol interfaces have underlying signature interfaces.
• Two protocol interfaces are compatible if their underlying signature interfaces are.
• The composition is given by union (of namespaces and mapping functions).
2006-06-27 LORIA, Nancy, France 28
Refinement
Alternating simulation
The sets of recursive finite state machines representing the protocol interfaces P and P’should be such that an alternating simulation relation holds (w.r.t. transitions labeled with actions in/not in the namespace of P/P’).
2006-06-27 LORIA, Nancy, France 29
Specifications
Specifications are used to capture additional properties of interest.
<SellItem,FAIL> ì{<ChkStore,OK>} U {<ProcPay,OK>}
The user should not be charged unless the item has already been found in store.
2006-06-27 LORIA, Nancy, France 30
Checking Specifications
2006-06-27 LORIA, Nancy, France 31
Checking Specifications
2006-06-27 LORIA, Nancy, France 32
Checking Specifications
2006-06-27 LORIA, Nancy, France 33
Compositional Refinement
P1 P2
P’1
compatible
<
If
2006-06-27 LORIA, Nancy, France 34
Compositional Refinement
P1 P2
P’1
Then
compatible
and (P’1 + P2) 4 (P1 + P2)
2006-06-27 LORIA, Nancy, France 35
Refinement Preserves Specifications
If P ² φ, then for all P’ such that P’ 4 P, we have P’ ² φ.
2006-06-27 LORIA, Nancy, France 36
Existence of Environment
P ² φ if and only if there exists an environment E of P, such that (P + E) ² φ.
If P1 and P’1 and P2 are such that P’1 4 P1, and P1 is compatible with P2, then for any specification φ if (P1 + P2) ² φ then (P’1 + P2) ² φ.
2006-06-27 LORIA, Nancy, France 37
Summary
Three classes of interfaces for web services, allowing to reason about:
- Compatibility,- Refinement, and- Specificationfor open systems.
2006-06-27 LORIA, Nancy, France 38
Thanks!
Questions, Comments ?
Recommended