Disciplining Orchestration and Conversation in Service-Oriented - - PowerPoint PPT Presentation

disciplining orchestration and conversation in service
SMART_READER_LITE
LIVE PREVIEW

Disciplining Orchestration and Conversation in Service-Oriented - - PowerPoint PPT Presentation

Disciplining Orchestration and Conversation in Service-Oriented Computing Ivan Lanese (Bologna), Vasco T. Vasconcelos (Lisbon), Francisco Martins (Lisbon), Antonio Ravara (Lisbon) The problem: change The problem: change Ubiquitous in


slide-1
SLIDE 1

Disciplining Orchestration and Conversation in Service-Oriented Computing

Ivan Lanese (Bologna), Vasco T. Vasconcelos (Lisbon), Francisco Martins (Lisbon), Antonio Ravara (Lisbon)

slide-2
SLIDE 2

The problem: change

slide-3
SLIDE 3

The problem: change

  • Ubiquitous in business:
slide-4
SLIDE 4

The problem: change

  • Ubiquitous in business:

New technologies, acquisitions, mergers.

slide-5
SLIDE 5

The problem: change

  • Ubiquitous in business:

New technologies, acquisitions, mergers.

  • Evil to programmers:
slide-6
SLIDE 6

The problem: change

  • Ubiquitous in business:

New technologies, acquisitions, mergers.

  • Evil to programmers:

Separation of soft development and soft maintenance is vanishing.

slide-7
SLIDE 7

Existing technologies won’t do

slide-8
SLIDE 8

Existing technologies won’t do

  • Objects incapable to cope with the

rapidly change of software systems

slide-9
SLIDE 9

Existing technologies won’t do

  • Objects incapable to cope with the

rapidly change of software systems

  • Components are usually delivered

physically; do not take advantage of internet-based computing

slide-10
SLIDE 10

Accommodating change: software services

  • Definitions abound. Here’s a recent
  • ne:

A coarse grain, discoverable entity that [..] interacts with applications and other services.

Elfatatry, CACM, Aug 2007

slide-11
SLIDE 11

Aim

  • Develop formal bases for Service

Oriented Computing (SOC):

  • including models and techniques
  • allowing for safe development of

applications

  • check that systems provide the

required functionality

slide-12
SLIDE 12

What this talk in not about

slide-13
SLIDE 13

What this talk in not about

  • Web services
slide-14
SLIDE 14

What this talk in not about

  • Web services
  • XML, SOAP, WSDL, ...
slide-15
SLIDE 15

What this talk in not about

  • Web services
  • XML, SOAP, WSDL, ...
  • We do not address:
slide-16
SLIDE 16

What this talk in not about

  • Web services
  • XML, SOAP, WSDL, ...
  • We do not address:
  • Service discovery, negotiation,

brokerage

slide-17
SLIDE 17

Outline

  • A motivating example
  • Semantics
  • Analyses
  • Conclusion
slide-18
SLIDE 18

Example: booking an hotel

  • A process

(date) {query-the-hotel-db}.price

slide-19
SLIDE 19

Example: booking an hotel

  • A process

receive a value

(date) {query-the-hotel-db}.price

slide-20
SLIDE 20

Example: booking an hotel

  • A process

receive a value some computation

(date) {query-the-hotel-db}.price

slide-21
SLIDE 21

Example: booking an hotel

  • A process

receive a value some computation send a value

(date) {query-the-hotel-db}.price

slide-22
SLIDE 22

Example: booking an hotel

  • A process

receive a value some computation send a value

(date) {query-the-hotel-db}.price

  • A service
slide-23
SLIDE 23

Example: booking an hotel

  • A process

receive a value some computation send a value

(date) {query-the-hotel-db}.price bologna => (date) {query-the-hotel-db}.price

  • A service
slide-24
SLIDE 24

Example: booking an hotel

  • A process

receive a value some computation send a value

(date) {query-the-hotel-db}.price bologna => (date) {query-the-hotel-db}.price

service name

  • A service
slide-25
SLIDE 25

Example: booking an hotel

  • A process

receive a value some computation send a value

(date) {query-the-hotel-db}.price bologna => (date) {query-the-hotel-db}.price

service name right arrow indicates provider

  • A service
slide-26
SLIDE 26

Example: the client

  • A service consumer

bologna <= 31Jul2007.(price) {use-price}

slide-27
SLIDE 27

Example: the client

  • A service consumer

bologna <= 31Jul2007.(price) {use-price}

  • An interaction
slide-28
SLIDE 28

Example: the client

  • A service consumer

bologna => ... | bologna <= ... bologna <= 31Jul2007.(price) {use-price}

  • An interaction
slide-29
SLIDE 29

Example: the client

  • A service consumer

bologna => ... | bologna <= ... bologna <= 31Jul2007.(price) {use-price}

provider

  • An interaction
slide-30
SLIDE 30

Example: the client

  • A service consumer

bologna => ... | bologna <= ... bologna <= 31Jul2007.(price) {use-price}

provider consumer

  • An interaction
slide-31
SLIDE 31

Example: the client

  • A service consumer

bologna => ... | bologna <= ... bologna <= 31Jul2007.(price) {use-price}

provider consumer

  • An interaction

parallel composition

slide-32
SLIDE 32

Example: a broker comes and...

slide-33
SLIDE 33

Example: a broker comes and...

...calls three services

slide-34
SLIDE 34

Example: a broker comes and...

bologna <= date.(price1) ... | azores <= date.(price2) ... | lisbon <= date.(price3) ...

...calls three services

slide-35
SLIDE 35

Example: a broker comes and...

  • How to collect the three prices in a

single process, for further processing? bologna <= date.(price1) ... | azores <= date.(price2) ... | lisbon <= date.(price3) ...

...calls three services

slide-36
SLIDE 36

Streams to the rescue

  • A service orchestrator

stream bologna <= date.(price1).feed price1 | azores <= date.(price2).feed price2 | lisbon <= date.(price3).feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-37
SLIDE 37

Streams to the rescue

  • A service orchestrator

stream bologna <= date.(price1).feed price1 | azores <= date.(price2).feed price2 | lisbon <= date.(price3).feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

write into the stream

slide-38
SLIDE 38

Streams to the rescue

  • A service orchestrator

stream bologna <= date.(price1).feed price1 | azores <= date.(price2).feed price2 | lisbon <= date.(price3).feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

write into the stream read from the stream

slide-39
SLIDE 39

Common patterns deserve abbreviations

(call bologna(date) | call azores(date) | call lisbon(date)) > x y > {publish-the-min-of-x-and-y}

slide-40
SLIDE 40

Common patterns deserve abbreviations

(call bologna(date) | call azores(date) | call lisbon(date)) > x y > {publish-the-min-of-x-and-y}

call service bologna; write the result into the pipe

slide-41
SLIDE 41

Common patterns deserve abbreviations

(call bologna(date) | call azores(date) | call lisbon(date)) > x y > {publish-the-min-of-x-and-y}

read two values from the pipe; call them x and y call service bologna; write the result into the pipe

slide-42
SLIDE 42

Common patterns deserve abbreviations

(call bologna(date) | call azores(date) | call lisbon(date)) > x y > {publish-the-min-of-x-and-y}

read two values from the pipe; call them x and y call service bologna; write the result into the pipe Inspired in Orc!

slide-43
SLIDE 43

Example: service composition

broker => (date).( (call bologna(date) | call azores(date) | call lisbon(date)) > x y > call min(x,y) > m > m)

slide-44
SLIDE 44

Example: service composition

broker => (date).( (call bologna(date) | call azores(date) | call lisbon(date)) > x y > call min(x,y) > m > m)

a service definition

slide-45
SLIDE 45

Example: service composition

broker => (date).( (call bologna(date) | call azores(date) | call lisbon(date)) > x y > call min(x,y) > m > m)

a service definition call a service to compute the min

slide-46
SLIDE 46

Example: service composition

broker => (date).( (call bologna(date) | call azores(date) | call lisbon(date)) > x y > call min(x,y) > m > m)

a service definition call a service to compute the min read the result

slide-47
SLIDE 47

Example: service composition

broker => (date).( (call bologna(date) | call azores(date) | call lisbon(date)) > x y > call min(x,y) > m > m)

a service definition call a service to compute the min read the result return it

slide-48
SLIDE 48

Clients won’t notice the difference

  • The client
  • Interaction as before

broker <= ... | broker => ... broker <= 31Jul2007.(price) {use-price}

slide-49
SLIDE 49

Clients won’t notice the difference

  • The client
  • Interaction as before

broker <= ... | broker => ... broker <= 31Jul2007.(price) {use-price}

Central to services!

slide-50
SLIDE 50

Syntax

P, Q ::= Processes P|Q Parallel composition | (νa)P Name restriction | Terminated process | X Process variable | rec X.P Recursive process definition | a ⇒ P Service definition | a ⇐ P Service invocation | v.P Value sending | (x)P Value reception | stream P as f in Q Stream | feed v.P Feed the process’ stream | f(x).P Read from a stream u, v ::= Values

Stream Protocol Service Process calculus

slide-51
SLIDE 51

Operational semantics: service invocation

bologna => (date) {...date...}.price bologna <= 31Jul2007.(price) {...price...}

slide-52
SLIDE 52

Operational semantics: service invocation

bologna => (date) {...date...}.price bologna <= 31Jul2007.(price) {...price...} nu r r :> (date) {...date...}.price r :> 31Jul2007.(price) {...price...}

slide-53
SLIDE 53

Operational semantics: service invocation

bologna => (date) {...date...}.price bologna <= 31Jul2007.(price) {...price...} nu r r :> (date) {...date...}.price r :> 31Jul2007.(price) {...price...}

new session channel

slide-54
SLIDE 54

Operational semantics: protocol

r|>(date) {...date...}.price r|> 31Jul2007. (price) {...price...}

slide-55
SLIDE 55

Operational semantics: protocol

r|>(date) {...date...}.price r|> 31Jul2007. (price) {...price...} r|> {... 31Jul2007...}.price r|>(price) {...price...}

slide-56
SLIDE 56

Operational semantics: streams

stream ... |feed 196 |... as f in f(x).f(y).{...x...y...}

slide-57
SLIDE 57

Operational semantics: streams

stream ... |feed 196 |... as f in f(x).f(y).{...x...y...} stream ... |nil |... as f=196 in f(x).f(y).{...x...y...}

slide-58
SLIDE 58

Operational semantics: streams

stream ... |feed 196 |... as f in f(x).f(y).{...x...y...}

enqueue

stream ... |nil |... as f=196 in f(x).f(y).{...x...y...}

slide-59
SLIDE 59

Operational semantics: streams

stream ... |nil|... as f=196 in f(x).f(y).{...x...y...}

slide-60
SLIDE 60

Operational semantics: streams

stream ... |nil|... as f=196 in f(x).f(y).{...x...y...} stream ... |nil|... as f in f(y).{...196...y...}

slide-61
SLIDE 61

Operational semantics: streams

dequeue

stream ... |nil|... as f=196 in f(x).f(y).{...x...y...} stream ... |nil|... as f in f(y).{...196...y...}

slide-62
SLIDE 62

Reduction semantics

  • Structural congruence - allows the

syntactic rearrangement of terms

(νn)P|Q ≡ (νn)(P|Q) if n / ∈ fn(Q) ( ) = ( )(

slide-63
SLIDE 63

Reduction semantics

  • Structural congruence - allows the

syntactic rearrangement of terms

(νn)P|Q ≡ (νn)(P|Q) if n / ∈ fn(Q) ( ) = ( )(

  • C

C C does not bind w or f stream P as f = v : : w in Cf(x).Q → stream P as f = v in CQ[w/

x]

  • Allows reduction at certain places in a

term

slide-64
SLIDE 64

Reduction semantics

  • Structural congruence - allows the

syntactic rearrangement of terms

(νn)P|Q ≡ (νn)(P|Q) if n / ∈ fn(Q) ( ) = ( )(

Sample rules!

  • C

C C does not bind w or f stream P as f = v : : w in Cf(x).Q → stream P as f = v in CQ[w/

x]

  • Allows reduction at certain places in a

term

slide-65
SLIDE 65

Labeled transition system

  • Sample rule:
  • Correspondence
  • Leads to bisimulation-based

equivalences

Q

f⇓ v

− − → Q′ stream P as f = w : : v in Q

τ

− → stream P as f = w in Q′ (L-STREAM-FEED, L-STREAM-CONS)

read v from stream f

Theorem 3.1 (Correspondence theorem) , P → Q if and only if P

τ

− → Q.

slide-66
SLIDE 66

What can go wrong? I: thread sync

25.P 39.Q

slide-67
SLIDE 67

What can go wrong? I: thread sync

two

  • utputs -> no

sync

25.P 39.Q

slide-68
SLIDE 68

What can go wrong? I: thread sync

two

  • utputs -> no

sync

25.P 39.Q 25.P nil

slide-69
SLIDE 69

What can go wrong? I: thread sync

two

  • utputs -> no

sync nobody listening -> no sync

25.P 39.Q 25.P nil

slide-70
SLIDE 70

What can go wrong? I: thread sync

two

  • utputs -> no

sync nobody listening -> no sync plus duals of the above

25.P 39.Q 25.P nil

slide-71
SLIDE 71

What can go wrong? II: intra-thread comm

25.P | (x).Q

slide-72
SLIDE 72

What can go wrong? II: intra-thread comm

am I writing or reading?

25.P | (x).Q

slide-73
SLIDE 73

What can go wrong? II: intra-thread comm

am I writing or reading?

25.P | (x).Q 25.P | 39.Q

slide-74
SLIDE 74

What can go wrong? II: intra-thread comm

am I writing or reading? am I writing or writing?

25.P | (x).Q 25.P | 39.Q

slide-75
SLIDE 75

What can go wrong? II: intra-thread comm

am I writing or reading? am I writing or writing? plus duals of the above

25.P | (x).Q 25.P | 39.Q

slide-76
SLIDE 76

The type of a protocol

(date) {query-the-hotel-db}.price

slide-77
SLIDE 77

The type of a protocol

(date) {query-the-hotel-db}.price ?Date.!Int.end

slide-78
SLIDE 78

The type of a protocol

(date) {query-the-hotel-db}.price ?Date.!Int.end

end of the protocol

slide-79
SLIDE 79

The type of a protocol

(date) {query-the-hotel-db}.price ?Date.!Int.end

end of the protocol no input or

  • utput here
slide-80
SLIDE 80

The type of a protocol

(date) {query-the-hotel-db}.price ?Date.!Int.end

end of the protocol no input or

  • utput here

31Jul2007.(price) {use-price}

slide-81
SLIDE 81

The type of a protocol

(date) {query-the-hotel-db}.price ?Date.!Int.end

end of the protocol no input or

  • utput here

31Jul2007.(price) {use-price} !Date.?Int.end

slide-82
SLIDE 82

Compatible protocols

?Date.!Int.end !Date.?Int.end

slide-83
SLIDE 83

Compatible protocols

?Date.!Int.end

the type

  • f the service

provider

!Date.?Int.end

slide-84
SLIDE 84

Compatible protocols

?Date.!Int.end

the type

  • f the service

provider

!Date.?Int.end

the type of the client

slide-85
SLIDE 85

Compatible protocols

?Date.!Int.end

the type

  • f the service

provider

!Date.?Int.end

the type of the client

slide-86
SLIDE 86

Compatible protocols

?Date.!Int.end

the type

  • f the service

provider

!Date.?Int.end

the type of the client Compatible protocols -> type safe

slide-87
SLIDE 87

Types for streams

stream ...feed price1 | ...feed price2 | ...feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-88
SLIDE 88

Types for streams

stream ...feed price1 | ...feed price2 | ...feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

all feeds of the same type

slide-89
SLIDE 89

Types for streams

stream ...feed price1 | ...feed price2 | ...feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

all feeds of the same type all reads of the same type

slide-90
SLIDE 90

Types for streams

stream ...feed price1 | ...feed price2 | ...feed price3 as f in f(x).f(y).{publish-the-min-of-x-and-y}

all feeds of the same type all reads of the same type Streams are monomorphic

slide-91
SLIDE 91

The type of a process is a pair

(date). stream ... |...feed price2 |... as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-92
SLIDE 92

The type of a process is a pair

(?Date.!Int.end, Int) (date). stream ... |...feed price2 |... as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-93
SLIDE 93

The type of a process is a pair

(?Date.!Int.end, Int) (date). stream ... |...feed price2 |... as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-94
SLIDE 94

The type of a process is a pair

(?Date.!Int.end, Int)

the type

  • f the protocol

(date). stream ... |...feed price2 |... as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-95
SLIDE 95

The type of a process is a pair

(?Date.!Int.end, Int)

the type

  • f the protocol

the type of the stream

(date). stream ... |...feed price2 |... as f in f(x).f(y).{publish-the-min-of-x-and-y}

slide-96
SLIDE 96

Sample rules

Γ, x: T ′ ⊢ P : (U, T) Γ ⊢ (x)P : (?T ′.U, T) Γ ⊢ P : (U, T) Γ ⊢ a: [U] Γ ⊢ a ⇒ P : (end, T) Γ ⊢ P : (U, T) Γ ⊢ Q: (end, T) Γ ⊢ P|Q: (U, T) Γ ⊢ P : (U, T) Γ, f : T ⊢ Q: (end, T ′) w ∈ Set( v) ⇒ Γ ⊢ w: T Γ ⊢ stream P as f = v in Q: (U, T ′)

input within a session service definition parallel composition stream

slide-97
SLIDE 97

Type safety

  • Subject reduction
  • Type safety

“Well typed programs do not go wrong”

If Γ ⊢ P : (U, T) and P → P ′, then Γ ⊢ P ′ : (U, T).

types for the free identifiers thread-sync + intra-thread comm

slide-98
SLIDE 98

Further analyses

  • Program equivalence (mentioned

before)

  • Deadlock avoidance:
  • communication errors within a

session (addressed before)

  • no service for a particular consumer

(several proposals in process calculi)

  • read from an empty stream (see

paper)

slide-99
SLIDE 99

Summary

  • Presented language

“Stream-based Service Centered Calculus” describing services, conversations, and orchestration

  • Amenable to different sort of analyses
  • Encoded of all van der Aalst workflow

patterns

slide-100
SLIDE 100

Future

http://www.sensoria-ist.eu/

  • Develop bisimulation techniques
  • Extend the language with some form of

failure/exception and corresponding compensation mechanism