Service-Orientation as a Paradigm of...

55
Theory of Programming Prof. Dr. W. Reisig Service-Orientation as a Paradigm of Computing Wolfgang Reisig Humboldt-Universität zu Berlin ICTERI Kiev, June 24, 2016

Transcript of Service-Orientation as a Paradigm of...

Page 1: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Theory of Programming

Prof. Dr. W. Reisig

Service-Orientation as a Paradigm of Computing

Wolfgang ReisigHumboldt-Universität zu Berlin

ICTERIKiev, June 24, 2016

Page 2: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

2

2012celebrated as the greatest computer scientist of the 20th century.

Basics of theoretical informatics:Turing Machines (1936)

What is the Basic Paradigmof Informatics ?

Page 3: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

alphabet Σ; finitely many symbols a, b, c, … ,zwords Σ*; countably many ab, ca, aca, …functions f: Σ* Σ*; uncountably many

Some of those functions are “computable” (countably many).

Each computable function can effectively be computed • by a computer (with unbounded store)• by an amazingly simple kind of machine, a Turing machine.

Yet, no computer can compute more functions.

3

Theoretical Informatics in a nutshell

→---

Page 4: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

useful, undisputed:

equivalence, abstraction/refinementcompositioncomplexitylogical characterizations

The computable functions pinpoint deep theoretical results and famous open problems.

So, the theory of computable functionsis frequently considered THE theory of informatics.

4

… lots of concepts

Page 5: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

This talk:

1. Aspects that exceed classical Theoretical Informatics2. A conceptual view on SOC3. Towards a Theory of Services4. Important aspect: Associative Composition

5

Page 6: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

This talk:

1. Aspects that exceed classical Theoretical Informatics2. A conceptual view on SOC3. Towards a Theory of Services4. Important aspect: Associative Composition

6

Page 7: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

How establish reliable communication?By sending acknowledgements, copies, etc. ,i.e. by means of distributed algorithms (“protocols”).

Informatics comprises communication

Complexity is not in computation but in communication.

7

Page 8: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Informatics comprisesnon-ending behavior

SOC “always on”

cloud

elevator control

business informatics “24/7”

classical view: terminating behavior is intended, infinite behavior is mistaken.

new view: infinite behavior is intended.terminating behavior is mistaken.

8

Page 9: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

c

a b

c

a b

c

a b

Informatics comprisescausal independence

a b a b a ac c cb …

d e d e d df f fe …

c

a b

9

f

ed

e

d

f e

d

f e

d

f

Page 10: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

e

a

ab

c

b

Informatics comprisescausal independence

de

d

a

d

f

cbe

……

……

……

+ fairness assumption

b…

motivated by “observation”

10

c

a b

c

a b

c

a b

e

d

f e

d

f e

d

fc

a b

f

ed

Page 11: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

11

Distributed Systems and Distributed Runs

a b a b a ac c cb …

d e d e d df f fe …

c

a b

f

ed

Page 12: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

a b a b a ac c cb …

d e d e d df f fe …

12

a variant: i-th b before i-th f

Avoid a naïve notion of “time”and of “observation”.

Causality structures the world

a deterministic systemno alternativesone behavior (run, execution)

c

a b

f

ed

Page 13: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

This talk:

1. Aspects that exceed classical Theoretical Informatics2. A conceptual view on SOC3. Towards a Theory of Services4. Important aspect: Associative Composition

13

Page 14: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

14

Paradigms of programming:1. Conventional (procedural) programs

follows the IPO model: input-process-output theoretical foundation/ expressive power: the computable functions

2. Object orientationattributes and methodstheoretical foundation: abstract data types / algebraic specifications / signatures and structures (as for 1st order logic)

3. Service orientationself contained components (reactive systems)loosely coupledtheoretical foundation: missing

Page 15: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

… intuitively …

imperative programing

Object Orientation

15

Page 16: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Service Oriented Computing

… intuitively …

16

Page 17: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

The Cloud

… intuitively …

17

Page 18: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

18

What is a Service?

… an algorithmic component, frequently software.

a person’s role:• booking a journey, • buying a ticket, • withdrawing cash

from an ATM.

software to • book a journey, • sell a ticket, • offer cash at

an ATM.

a technical system:• elevator • self driving vehicle• mobile phone

an organization, providing • insurance• medical surgery

Page 19: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

19

Services interact loosely coupled.In general: message passing; not handshaking.Interacting services (instantiations) jointly pursue a goal.They reach their goal

Services interact goal oriented

A frequent goal of composed services:to reach a final state together.

Often: Two services play the role of a provider and a requester, together with a broker.

, or miss it.

Page 20: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

20

InstantiationsA service may spawn many instantiations.Input as last timedoes NOT yield output as last time

Two instantiations may• temporally overlap, • interact,• behave differently. • Different instantiation may

start in different states.

Page 21: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

21

A formal foundation is a base to ...• describe semantics of implementations

• characterize expressivity of formalisms

• relate representations (equivalence, simulation)

• clarify the elementary notions of the area

• derive properties from structural and behavioral descriptions

• teach the area systematically

Page 22: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

22

Structure of textbooks on SOAFirst part:in plain English:“… SOA is an implementation independent concept …”,using many notions, poorly related.

Second part:examples of implementations,confusing conceptual aspects and language dependent aspects

Missing bridge:implementation independent models.

Page 23: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

This talk:

1. Aspects that exceed classical Theoretical Informatics2. A conceptual view on SOC3. Towards a Theory of Services4. Important aspect: Associative Composition

23

Page 24: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

24

Semantics of Services We should do it in analogy to programming languages:

The semantics of a service is a mathematical object!

True, this is presently not the case.

BUT WE SHOULD spend effort into this!

Page 25: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

towards a generic modeling language

aim of ageneric Mod. language

expressive power (L)

all modeling languages Lfor services

aim of, e.g.BPMN:

expressive power (L)

all modeling languages Lfor services

25

Page 26: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

26

... a transition system with channelsfor asynchronous communicationwith its environment.

Semantics of S:During a computation, each channel funnels a stream of data.

technically:a relation on – infinite – streams

S

a

b

c

Models of services

Page 27: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

27

Requirements:

The – elementary – notion of composition of services is a (simple!) mathematical (or logical!) operation.

For services S and T,the composition S ⊕ Tis a service again.

Frequently, S ⊕ T does not interact any more.

ticketing =def

sell_ticket ⊕ buy_ticket

Interaction is represented as composition

Page 28: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

How to compose services?

28

Composition S ⊕ T has pending channels.… is a service again.

Tb

e

dS ⊕ T

S

a

b

c

Page 29: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Requirements at composed services

29

S and T communicate boundedlyS and T communicate responsively

With target states:S ⊕ T weakly terminates S ⊕ T is deadlock freeS ⊕ T is lifelock free

… as CTL* formulas:S ⊕ T AG n-boundedS ⊕ T AGEF responsive

S ⊕ T AGEF terminalS ⊕ T AG (terminal target)S ⊕ T AGEF target

Tb

e

dS ⊕ T

S

a

b

c

Together, services may accomplish a requirement, ρ.

Page 30: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

For a requirement ρ …

30

S and T communicate boundedlyS and T communicate responsively

With target states:S ⊕ T weakly terminates S ⊕ T is deadlock freeS ⊕ T is lifelock free

Def.: Let ρ be a requirement on services.

(i) S and T are ρ -partnersiff S ⊕ T ρ

(ii) S is substitutable by Tiff for all U,S ⊕ U ρ implies T ⊕ U ρ

(iii) U is a ρ -adapter for S and Tiff S ⊕ U ⊕ T ρ

Tb

e

dS ⊕ T

S

a

b

c

Page 31: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

31

properties of services Quests at the partners of a service, S ,w.r.t a requirement ρ :

Does S have ρ -partners at all ? Is T a ρ -partner of S ?How construct a canonical ρ -partner of S ?How characterize all ρ -partners of S ?

ControllabilityComposability“most liberal”

Operating Guideline

Page 32: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

32

Given:• a set S of services,• a composition operator ⊕ : S × S S,• a set Q of requirements ρ1, ... , ρn ⊆ S.This yields the algebraic structure

(S; ⊕ , Q ).

For S, T ∈ S, ρ∈Q,T is a ρ - partner of S,iff S ⊕ T ρ.

Let semρ(S) =def the set of all ρ - partners of S.

The algebraic structure of servicesthe “classical” requirement

ρ : weak termination

derived notions(w.r.t some ρ ):

S may be substituted by S‘ : semρ(S) ⊆ semρ(S‘ )

S and T are equivalent: semρ(S) = semρ(T)

U adapts S and T: S ⊕ U ⊕ T ρ

S ⊕ T ∈ ρρ ( S ⊕ T )

Page 33: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

This talk:

1. Aspects that exceed classical Theoretical Informatics2. A conceptual view on SOC3. Towards a Theory of Services4. Important aspect: Associative Composition

33

Page 34: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Composing many services

34

Tb

e

dS ⊕ T

S

a

b

c

e.g. a supply chain

Page 35: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

a simple idea

35

(S ⊕ T)

S

a

b

c

Tb

e

d

b

e

f

⊕ U

Ub

e

d

b

e

f

Page 36: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

a simple idea

36

S

a

b

c

Tb

e

d

b

e

f

Ub

e

d

b

e

f

associativity: inevitable for composition!… and universally feasible:Identify two sets of channels: left port, right port.

S ⊕ (T ⊕ U)

Tb

e

d

b

e

f

leftport

rightport

(S ⊕ T) ⊕ U =

Page 37: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Example: vending machinedad pays, mom selects,

tea!

juice!

momdad

coin coin

tea!

juice!

beverage

vend. mach

37

Page 38: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

coin

tea!

juice!

beverage

beverage

kid

tea!

juice!

momdad

coin

Example: vending machinedad pays, mom selects, kid drinks.

vend. mach

38

Page 39: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

juice!

tea!

mom

coin

juice!

tea!

beverage

dad

coin

kid

A variant of the vending machinedad pays, mom selects, kid drinks.

beverage

vend. mach

39

Page 40: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2requester

R1

exclusive requester

N1provider

40

Page 41: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2requester

R1

exclusive requester

N1provider

41

Page 42: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2requester

R1

sharing requester

N1provider

42

Page 43: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2requester

R1

sharing requester

N1provider

43

Page 44: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2‘ requester

N2requester

second sharing requester

N1provider

44

Page 45: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2‘ requester

N2requester

second sharing requester

N1provider

45

Page 46: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

N2‘ requester

N2requester

third sharing requesterN2‘‘

requester

skip the primes:N1 N2 N2 N2N1

provider

46

Page 47: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

generic sharing requesters

P provider

Qrequester

D

D

D

D

M

Qrequester

Qrequester

P Q Q

P Q Q Q

P Q

genericreques-ter Q : Q

requester

D

M

RL

47

Page 48: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

prefer this variant?

P provider

Qrequester

D

D

D

D

M

Qrequester

Qrequester

P Q Q Q

P Q

A

A

A

A

A

A

48

P Q Q

genericrequester Q : Q

requester

D

M

RL

Page 49: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

prefer this variant?

P provider

Qrequester

D

D

D

D

M

Qrequester

Qrequester

P Q Q

P Q Q Q

P Q

A

49

A

genericrequester Q : Q

requester

D

M

RL just make

a member of L

Page 50: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

21

Cyclic composition: The philosophers

A

32 B 43 C 54 D 15 E

This is A B C D EThe problem: How glue ?Construct the closure (A B C D E)c

50

Page 51: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

2 32 B 43 C 54 D 15 E1

Cyclic composition: The philosophers

A

This is A B C D EThe problem: How glue ?Construct the closure (A B C D E)c

51

Page 52: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

... with a generic philosopher

rl p

algebraic form: (p p p p p)c

52

rp rp rp rp

Page 53: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

53

Given:• a set S of services,• a composition operator ⊕ : S × S S,• a set Q of requirements ρ1, ... , ρn ⊆ S.This yields the algebraic structure

(S; ⊕ , Q , ).

For S, T ∈ S, ρ∈QT is a ρ - partner of S,iff S ⊕ T ρ.

Let semρ(S) =def the set of all ρ - partners of S.

The algebraic structure of services

c

Page 54: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

The algebraic structure of clouds

54

Page 55: Service-Orientation as a Paradigm of Computingicteri.org/sites/default/files/Reizig-2016-06-23-Kiev-ICTERI-2016.pdf · Kiev, June 24, 2016. 2 2012 celebrated as the greatest computer

Theory of Programming

Prof. Dr. W. Reisig

Service Orientation as a paradigm of computing

Wolfgang ReisigHumboldt-Universität zu Berlin

ICTERIKiev, June 24, 2016