61
1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

Embed Size (px)

DESCRIPTION

3 SOA Seminar Definitions (2) “SOA is the architectural style that supports loosely coupled services to enable business flexibility in an interoperable, technology agnostic manner. SOA consists of a composite set of business-aligned services that support a flexible and dynamically re- configurable end-to-end business process realization using interface- based service descriptions.” From a paper by Borges, Holley and Arsanjani.

Citation preview

Page 1: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

1SOA Seminar

Seminar on Service Oriented Architecture

Definitions and a mathematical description of

business processes

Page 2: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

2SOA Seminar

Definitions (1)• “A Service-Oriented Architecture

(SOA) is a way of organizing software so that companies can respond quickly to the changing requirements of the marketplace. The technology is based on services, which are customized units of software that run in a network.” From SOA for Business Developers by Margolis.

Page 3: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

3SOA Seminar

Definitions (2)• “SOA is the architectural style that

supports loosely coupled services to enable business flexibility in an interoperable, technology agnostic manner. SOA consists of a composite set of business-aligned services that support a flexible and dynamically re-configurable end-to-end business process realization using interface-based service descriptions.” From a paper by Borges, Holley and Arsanjani.

Page 4: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

4SOA Seminar

Definitions (3)• Service-oriented architecture (SOA) is a

methodology for achieving application interoperability and reuse of IT assets that features:

- A strong architectural focus, including governance, processes, modeling, and tools.

- An ideal level of abstraction for aligning business needs and technical capabilities, and creating reusable, course- grain business functionality.

Page 5: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

5SOA Seminar

Definitions (3) Continued - A deployment infrastructure on which

new applications can quickly and easily be built.

- A reusable library of services for common business and IT functions.

From Newcomer and Lomow

Page 6: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

6SOA Seminar

Web Services Preferred(1)• Web Services are XML-based

technologies for messaging, service descriptions, discovery, and external features providing:

- Pervasive open standards for distributed computing interface descriptions and document exchange via messages

From Newcomer

Page 7: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

7SOA Seminar

Web Services Preferred(2) - Independence from the underlying execution environment and application platforms. - Extensibility for enterprise qualities of service such as security, reliability, and transactions. - Support for composite applications such as business process flows, multi-channel access, and rapid integration

Page 8: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

8SOA Seminar

XML Preferred (1) • The Extensible Markup Language is a

common, independent data format across the enterprise and beyond that provides:

- Standard data types and structures, independent of any programming language, development environment or software system.

From Newcomer

Page 9: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

9SOA Seminar

XML Preferred (2) - Pervasive technology for defining

business documents and exchanging business information, including standard vocabularies for many industries.

- Ubiquitous software for handling operations on XML, including parsers, queries, and transformations.

From Newcomer

Page 10: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

10SOA Seminar

Build an SOA in 8 Steps(1) Business needs come first (not services) What problem are we trying to solve?(2) What aspects can be implemented as services? Old services? New services? Legacy wrappers?(3) Track services with registries and

repositories.Modified from a talk by Daryl Plummerof Gartner.

Page 11: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

11SOA Seminar

Build an SOA in 8 Steps(4) Govern the services. We need to encourage desired behavior at many levels, across enterprises, and at different stages. We need to monitor behavior, enforce policies & assess user satisfaction.

Page 12: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

12SOA Seminar

Build an SOA in 8 Steps(5) Secure the services. Using established standards, we need privacy, authentication, and authorization. This may need to be federated security (over more than one organization.)

Page 13: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

13SOA Seminar

Build an SOA in 8 Steps(6) Manage the services. Are messages arriving on time? Is everything operating properly?(7) Virtualization through mediation. Are we free to move and change the services? Do we need an ESB that acts

as a central hub for message routing and transformations?

(8) Design for interoperability through the adoption of standards.

Page 14: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

14SOA Seminar

Objectives of This Course• Focus on foundations of SOA• Foundations include: Mathematical models Petri nets and π-calculus Important standards and technologies Orchestration and Choreography The Enterprise Service Bus The SOA Reference Model Reference Architectures Enterprise Integration Patterns

Page 15: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

15SOA Seminar

A Mathematical Foundation

• Petri Nets• Petri Nets as applied to Web

Services• Why not flow charts?• Why not UML sequence diagrams?• We want to work at a higher level

and exploit parallel execution.• Plus, Petri nets are cool!

Page 16: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

16SOA Seminar

Petri Nets Consider the following program: a = 1; b = 2; c = 3; a = a + 1; c = b + c; b = a + c;

What is the normal process order?

Other orderings are possible.

Page 17: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

17SOA Seminar

Petri Nets A Petri net is a directed graph G =

(V,E), where V = P U T and P T = . Any edge e in E is incident on one member of P and one member of T. The set P is called the set of places (conditions) and the set T is the set of transitions (events).

Page 18: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

18SOA Seminar

Petri Nets Places are typically drawn as

circles and transitions as bars.

p1

p3

t1

t2

p2

p4

t3

Page 19: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

19SOA Seminar

Petri Net G = (V,E)P = {p1,p2,p3,p4}T = {t1,t2,t3}E = {(p1,t1),(t1,p2),(p2,t3),(p3,t1),(p3,t2),(t2,p4),(p4,t3)}

p1

p3

t1

t2

p2

p4

t3

Page 20: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

20SOA Seminar

A Marked Petri Net A marking of a Petri net assigns each place a

nonnegative integer n. We say each place p is marked with n tokens. Tokens are represented as black dots.

**

* *

p1

p3

t1

t2

p2

p4

t3

Page 21: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

21SOA Seminar

Firing Transitions In a Petri net, if an edge is directed from

place p to transition t, we say p is an input place for transition t. An output place is defined similarly. If every input place for a transition t has at least one token, we say that t is enabled. A firing of an enabled transition removes one token from each input place and adds one token to each output place. A transition can fire only if it’s enabled. Firing a transition is an atomic operation.

Page 22: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

22SOA Seminar

Fire Transition t1 (ready?)

* *

p1

p3

t1

t2

p2

p4

t3

**

Page 23: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

23SOA Seminar

Transition t1 Fired

*

*

p1

p3

t1

t2

p2

p4

t3

*

Page 24: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

24SOA Seminar

Fire Transition t3 (Ready?)

*

*

p1

p3

t1

t2

p2

p4

t3

*

Page 25: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

25SOA Seminar

Transition t3 Fired

p1

p3

t1

t2

p2

p4

t3

*

Page 26: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

26SOA Seminar

Petri Nets Consider again the following

program: a = 1; b = 2; c = 3; a = a + 1; c = b + c; b = a + c;

Page 27: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

27SOA Seminar

Modeled as a Petri Net

*

*

*

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c

Page 28: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

28SOA Seminar

Fire Transitions (ready?)

*

*

*

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c

Page 29: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

29SOA Seminar

Transitions Fired

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c

*

*

*

Page 30: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

30SOA Seminar

Fire Transitions (Ready)

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c

*

*

*

Page 31: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

31SOA Seminar

Transitions Fired

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c*

*

Page 32: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

32SOA Seminar

Fire Last Transition (Ready?)

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c*

*

Page 33: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

33SOA Seminar

Last Transition Fired

p1

p2

p3

p4

p5

p6

p7

p8

p9

a=1

b=2

c=3

a=a+1

c=b+c

b=a+c*

Page 34: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

34SOA Seminar

Quiz

The Petri Net we drew begins with three markings.Redraw the Petri net so that it begins with a single marking.

Page 35: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

35SOA Seminar

LivenessA Petri net is deadlocked if no transition can fire.

A marking M for a Petri net is live if, beginning from M, nomatter what sequence of firings has occurred, it is possibleto fire any given transition by processing through someadditional firing sequence.

If a marking M is live for a Petri net P, then no matter whatsequence of transitions is fired, P will never deadlock. Indeed,we can fire any transition by proceeding through some additional firing sequence.

Page 36: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

36SOA Seminar

Deadlock ExampleCase: Person 1 requests disk drive D. D is ready. Person 1 requests printer P. P is ready. Person 1 uses and releases P and D. P and D are available.

Case: Person 1 requests disk drive D. D is ready. Person 2 requests printer P. P is ready. Person 1 is waiting for person 2 to release P. Person 2 is waiting for person 1 to release D. No transitions can fire and we have deadlock.

Page 37: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

37SOA Seminar

D available

Request D

D ready

Finished with D and P

ReleaseD and P

Request D

D ready

Finished with D and P

Process Process

P ready

Request P Request PP available

ReleaseD and P

*

P ready

Person 1 Person 2 *

Page 38: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

38SOA Seminar

Deadlock

38Master of Information System Management

Four Requirements for deadlock:

(1) Resources need mutual exclusion. They are not thread safe. (2) Resources may be reserved while a process is waiting for more. (3) Preemption is not allowed. You can't force a process to give up a resource. (4) Circular wait is possible. X wants what Y has and Y wants what Z has but Z wants what X has.

Solutions (short course):

Prevention (disallow one of the four) Avoidance (study what is required by all before beginning) Detection and recovery (reboot if nothing is getting done)

Page 39: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

39SOA Seminar

Definition: Service Net (ordinary Petri Net - no parallel arcs) SN = (P, T, w, i, o, l)

P is a finite set of places or service statesT is a finite set of transitions or service operationsw (P X T) (T X P) is a set of directed arcs or flow relationsi is the input place with •i = {x P T (x,i) w } = so no flow points to this place

o is the output place with •o = {x P T (o,x) w } = so no flow departs from this place

L: T --> A {t} is a labeling function where A is a set of operation names. We assume t A and denotes a silent operation.W may be viewed as a function w: (P X T) (T X P) --> {0,1}

Silent operations are transition firings that cannot be observed. They are usedto distinguish between internal and external behavior of the service.

Page 40: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

40SOA Seminar

Definition Web Service

S = (NameS, Desc, Loc, URL, CS, SN)NameS Name of service used as a unique identifierDesc Summarizes what the service offersLoc Is the server the service is located inURL Is the location of the serviceCS Is a set of its component services. If CS = {NameS} then

S is a basic service. Otherwise S is a composite serviceSN = (P, T, w, i, o, l) is the service net modeling the dynamic behavior of the

service

The execution of S starts when a token is in the place i and terminates when atoken reaches the place o.

S has a specific task to perform and may depend on other web services.

Page 41: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

41SOA Seminar

Create new web services out of existing ones as building blocks:

S :: The service that does nothing X A basic service S1 S2 S1 followed by S2 Sequence operator S1 S2 S1 xor S2

S1◊ S2 arbitrary sequence µS iteration on S S1 c S2 parallel with communication (S1S2) --> S3 As soon as S1 or S2 do S3

[S1(p1,q1):(SN(pn,qn)]| dynamically select one of many to execute Ref(S1,a,S2) Do S1 with any ‘a’ operations replaced by S2

Each operation returns a service that may or may not be involved withother operations.

Page 42: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

42SOA Seminar

*P

The Empty Service

Page 43: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

43SOA Seminar

*

: ::

Service S1

S1 i1

o1

:

Page 44: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

44SOA Seminar

*

: ::

Service S2

S2 i2

o2

:

Page 45: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

45SOA Seminar

*

: ::

Service S3

S3 i3

o3

:

Page 46: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

46SOA Seminar

*

: :

: :

Sequence S1 S2

: :

i = i1

i2

o=o2

S1

S2

o1

Page 47: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

47SOA Seminar

Alternative S1 S2i

i1i2

o

o1 o2

… …

… …

S1S2

Page 48: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

48SOA Seminar

Arbitrary Sequence S1 ◊ S2

S1S2

p1

p3

p2

i2i1

p5p4

o2o1

Page 49: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

49SOA Seminar

S1

o

o1

i1i

Services µS1

… …

… … ..

Page 50: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

50SOA Seminar

S1S2

i2

o2

o

o1

i1

Services S1 ||c S2

p1

p2

Page 51: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

51SOA Seminar

o

o3

Services (S1|S2) ~>S3

p1

p2

o2

S2

S1 i1 i2

o1

S3i3

Will wait until S1 or S2 completes

Will wait for the later one to complete

This operation isa discriminator.S1 and S2 may betwo services providingthe results of the same complex query. We take the first to complete.

Page 52: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

52SOA Seminar

……

o1on

q1qn

send_resp_1 send_resp_n

rec_req_nrec_req_1

p1 pn

i1in

select_servu

send_req_serv Sn

q

S1

p

o

Assume middle branch gains info on service qualities. The two services provide two entry points.

Services [S1(p1,q1):Sn(pn,qn)]i

Page 53: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

53SOA Seminar

An Example of Refinement

assess_claim

indemnity_customer convoke_customer

S1

o1

i1

Page 54: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

54SOA Seminar

An Example of Refinement

i2

o2

assess_simple_claim assess_complex_claim

o

i

Ref(S1,assess_claim,S2)

indemnify_customer

assess_simple_claim

convoke_customer

assess_complex_claims

S2

Page 55: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

55SOA Seminar

Example Service (SM ||c1( OCS|| c2 IP))

OCS : Online Computing StoreSM : Sony MonitorsIP : Intel Processors

The Online Computing Store needs Sony monitors andIntel processors.

Page 56: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

56SOA Seminar

Example Service SM ||c1( OCS|| c2 IP)

IP

rec_ord_pr

send_del_pr

OCS

send_ord_pr

rec_del_pr

assemble_PC

rec_del_mon

send_ord_mon

rec_ord_pcSM

rec_ord_mon

send_del_mon

o

OCS || c2 IP

Page 57: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

57SOA Seminar

A QuizDescribe this web service in words.

Ref(S1, assess_claim, [A1:An])

Page 58: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

58SOA Seminar

Properties of The Service Algebra

S1 (S2 S3) = (S1 S2) S3 (1)

S = S (2)S = S (3)S1 S2 = S2 S1 (4)S1 (S2 S3) = (S1 S2) S3 (5)S S = S (6)(S1 S2) S3 = (S1 S3)(S2 S3) (7)S1 S2 = (S1 S2) (S2 S1) (8)

Each operation returns a web service.

Page 59: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

59SOA Seminar

Desired Properties of the Service Algebra

= (9)

S1 c S2 = S2 c S1 (10)

S1 (S2 S3) = (S1 S2) S3 (11)

S = S (12)

(S1S2) ~>S3 = (S2S1) ~> S3 (13)

(S1 ) ~> S2 = S1 S2 (14)(S1S2) ~> = S1 S2 (15)

Page 60: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

60SOA Seminar

Desired Properties of the Service Algebra

{i1,…,in} ={1,…,n} Si= Si

(16)

If Sj = then Si = Si

(17)

Ref(S1,a,S2) = S1 if a L1(T1) (18)S1 S2 = S2 S1 (from (8) and (4)) (19)

S S = S S (from (8) and (6)) (20)S = S (from (8), (2), (3), and (6)) (21)

i {i1,…,in}i=1

n

n

i=1 i=1,ij

n

Select the best of n servicesw/o concern for initial state names.

Don’t select the empty service.

If a is not an operation then no refinement.

Page 61: 1 SOA Seminar Seminar on Service Oriented Architecture Definitions and a mathematical description of business processes

61SOA Seminar

ProofProve: S1 S2 = S2 S1

S1 S2 = (S1 S2) (S2 S1)

(S1 S2) (S2 S1) = (S2 S1) (S1 S2) = S2 S1