web service interfaces - loria

38
Web Service Interfaces Dirk Beyer Arindam Chakrabarti Thomas A. Henzinger

Upload: others

Post on 18-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Service Interfaces - LORIA

Web Service Interfaces

Dirk BeyerArindam ChakrabartiThomas A. Henzinger

Page 2: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 2

Buying a Book

Amazon

FedEx

Springer

VISA

BofA

Page 3: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 3

Stand-alone software development scenario

Specification Write Code Compile/Build Test

Page 4: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 4

Web software development scenario

Amazon

FedEx

Springer

VISA

BofA

Specification Write Code Compile/Build Test

Page 5: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 5

Web Service Interfaces

• Web methods: m ∈ M• Namespace: N ⊆ M• Instances: i• Actions: <m,i>

Page 6: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 6

Actions

<SellItem, SOLD>

<ChkAvail,OK>

Page 7: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 7

Web Service Interfaces

We provide three of them:- Signature interfaces- Consistency interfaces- Protocol interfaces

Page 8: Web Service Interfaces - LORIA

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> }

Page 9: Web Service Interfaces - LORIA

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.

Page 10: Web Service Interfaces - LORIA

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).

Page 11: Web Service Interfaces - LORIA

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.<

Page 12: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 12

Refinement

Bank’

Bank

4

Page 13: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 13

Consistency Interfaces

Page 14: Web Service Interfaces - LORIA

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).

Page 15: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 15

Supply Chain Management Application

Page 16: Web Service Interfaces - LORIA

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.

Page 17: Web Service Interfaces - LORIA

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).

Page 18: Web Service Interfaces - LORIA

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.<

Page 19: Web Service Interfaces - LORIA

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.

Page 20: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 20

Compositional Refinement

C1 C2

C’1

compatible

<

If

Page 21: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 21

Compositional Refinement

C1 C2

C’1

Then

compatible

and (C’1 + C2) 4 (C1 + C2)

Page 22: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 22

Refinement Preserves Specifications

If C ² φ, then for all C’ such that C’ 4 C, we have C’ ² φ.

Page 23: Web Service Interfaces - LORIA

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) ² φ.

Page 24: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 24

Protocol Interfaces

Page 25: Web Service Interfaces - LORIA

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.

Page 26: Web Service Interfaces - LORIA

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

Page 27: Web Service Interfaces - LORIA

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).

Page 28: Web Service Interfaces - LORIA

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’).

Page 29: Web Service Interfaces - LORIA

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.

Page 30: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 30

Checking Specifications

Page 31: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 31

Checking Specifications

Page 32: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 32

Checking Specifications

Page 33: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 33

Compositional Refinement

P1 P2

P’1

compatible

<

If

Page 34: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 34

Compositional Refinement

P1 P2

P’1

Then

compatible

and (P’1 + P2) 4 (P1 + P2)

Page 35: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 35

Refinement Preserves Specifications

If P ² φ, then for all P’ such that P’ 4 P, we have P’ ² φ.

Page 36: Web Service Interfaces - LORIA

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) ² φ.

Page 37: Web Service Interfaces - LORIA

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.

Page 38: Web Service Interfaces - LORIA

2006-06-27 LORIA, Nancy, France 38

Thanks!

Questions, Comments ?