Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Architecture
Lecture 1: Introduction
Course Introduction
Some principles and definitions
Some Theory
Technology Foundations
Homework 1
Getting logged on to Oracles
SOA Suite
95-843: Service Oriented Architecture
Master of Information System
Management
Course Software
We will be using Oracle SOA Suite 11g R1
for projects and demonstrations.
It will be assumed the the student is able to
program in Java and use an IDE.
Readings
For this week, read the Introduction
to Petri Nets and the paper A Petri
Net-based Model for Web Service
Composition.
Read Chapter One of Oracle SOA
Suite 11g R1.
Read the Introduction and Chapter 1
of Understanding SOA with Web
Services.
95-843: Service Oriented Architecture
Master of Information System
Management
What is architecture?
Victorian Gothic
or Neo-Gothic
architecture
Architecture From
Reynolds Text
Architecture implies a consistent and coherent design
approach. Essential principles include:
Consistency: The same challenges
should be addressed in a uniform way.
Reliability: The structures created must be fit to
purpose and meet the demands for which they are
designed.
Extensibility: A design must provide a framework that
can be expanded in ways both foreseen and
unforeseen.
Scalability: The implementation must be capable of
being scaled to accommodate increasing load by adding
hardware to the solution.
95-843: Service Oriented Architecture
Master of Information System
Management
Chapter one
of Reynolds
10
SOA Defined
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 reconfigurable end-to-end business
process realization using interfacebased service descriptions. From a paper
by Borges, Holley and Arsanjani.
95-843: Service Oriented Architecture
Master of Information System
Management
11
From Newcomer
12
13
14
From Newcomer
95-843: Service Oriented Architecture
Master of Information System
Management
15
Modified from a
talk by Daryl
Plummer
16
of Gartner.
17
18
19
20
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!
95-843: Service Oriented Architecture
Master of Information System
Management
21
Petri Nets
Consider the following program:
a = 1;
What is the normal process order?
b = 2;
c = 3;
Other orderings are possible.
a = a + 1;
c = b + c;
b = a + c;
95-843: Service Oriented Architecture
Master of Information System
Management
22
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).
23
Petri Nets
Places are typically drawn as circles and transitions as bars.
p1
t1
p2
t3
p3
t2
p4
24
p1
t1
p2
t3
p3
t2
p4
25
t1
t3
*
p3
p2
*
t2
p4
26
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 its
enabled. Firing a transition is an atomic
operation.
95-843: Service Oriented Architecture
Master of Information System
Management
27
**
p1
t1
t3
*
p3
p2
*
t2
p4
28
Transition t1 Fired
*
p1
t1
p2
t3
*
p3
t2
p4
29
*
p1
t1
p2
t3
*
p3
t2
p4
30
Transition t3 Fired
*
p1
t1
p2
t3
p3
t2
p4
31
Petri Nets
Consider again the following
program:
a = 1;
b = 2;
c = 3;
a = a + 1;
c = b + c;
b = a + c;
95-843: Service Oriented Architecture
Master of Information System
Management
32
a=1
p1
b=2
a=a+1
p4
b=a+c
p7
*
p2
p5
p9
c=3
*
p3
c=b+c
p8
p6
95-843: Service Oriented Architecture
Master of Information System
Management
33
a=1
p1
b=2
a=a+1
p4
b=a+c
p7
*
p2
p5
p9
c=3
*
p3
c=b+c
p8
p6
95-843: Service Oriented Architecture
Master of Information System
Management
34
Transitions Fired
a=1
*
p1
b=2
a=a+1
p4
b=a+c
*
p2
p7
p5
p9
c=3
*
p3
c=b+c
p8
p6
95-843: Service Oriented Architecture
Master of Information System
Management
35
a=a+1
p4
b=a+c
*
p2
p7
p5
p9
c=3
*
p3
c=b+c
p8
p6
95-843: Service Oriented Architecture
Master of Information System
Management
36
Transitions Fired
a=1
p1
b=2
a=a+1
p4
b=a+c
p7
p2
p5
c=b+c
p9
c=3
p8
p3
p6
95-843: Service Oriented Architecture
Master of Information System
Management
37
a=a+1
p4
b=a+c
p7
p2
p5
c=b+c
p9
c=3
p8
p3
p6
95-843: Service Oriented Architecture
Master of Information System
Management
38
a=a+1
p4
b=a+c
p7
p2
p5
c=b+c
p9
c=3
p8
p3
p6
95-843: Service Oriented Architecture
Master of Information System
Management
39
In This Class
All of our Petri Nets will begin with a single input place and
end with a single output place.
We will always start the Petri Net off with a single token in the
input place.
40
Modeling a process
When a flight lands, passengers are asked to remain seated
until the plane stops and the seat belt sign is off. Then, people
gather their belongings and leave the plane. At that point, each
seat area is checked by two flight attendants.
How would you model this business process with a Petri net?
41
(2) Build a Petri net to wash a lion based on the following steps.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Get lion.
Get soap. (real soap not SOAP)
Get tub.
Put water in tub.
Put lion in tub.
Wash lion with soap.
Rinse lion.
Remove lion from tub.
Dry
lion.
95-843:
Service Oriented Architecture
Master of Information System
Management
42
Liveness
A Petri net is deadlocked if no transition can fire.
A marking M for a Petri net is live if, beginning from M, no
matter what sequence of firings has occurred, it is possible
to fire any given transition by processing through some
additional firing sequence.
If a marking M is live for a Petri net P, then no matter what
sequence of transitions is fired, P will never deadlock. Indeed,
we can fire any transition by proceeding through some
additional firing sequence.
43
Deadlock Example
Case:
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.
44
D available
*
Request D
Request D
D ready
D ready
Finished
with D and P
Release
D and P
Finished
with D and P
Process
Process
P ready
P ready
Request P
Release
D and P
P available
Person 1
95-843: Service Oriented Architecture
Master of Information System
Management
Request P
*
Person 2
45
Deadlock
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)
46
arbitrary sequence
S
iteration on S
S1 c S2
parallel with communication
(S1 S2) --> 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 with
95-843: Service Oriented Architecture
other operations.
47
Master of Information System
Management
P
*
48
Service S1
S1
i1
*
:
:
:
:
o1
49
Service S2
S2
i2
*
:
:
:
:
o2
50
Service S3
S3
i3
:
:
:
:
o3
51
Sequence S1 S2
i = i1
*
S1
:
:
o1
S2
i2
:
:
o=o2
52
Alternative S1 S2
S1
i1
S2
i2
o1
o2
o
95-843: Service Oriented Architecture
Master of Information System
Management
53
Arbitrary Sequence S1 S2
p1
p3
S1
p2
S2
i1
i2
o1
p4
95-843: Service Oriented Architecture
Master of Information System
Management
o2
p5
54
Services
S1
S1
i1
o1
..
55
Services S1 ||c S2
S2
S1
i2
i1
p1
p2
o1
o2
o
56
i1
S2
i2
o1
o2
p1
This operation is
a discriminator.
S1 and S2 may be
two services providing
the results of the
same complex query.
We take the first
to complete.
p2
S3
i3
o3
o
Services [S1(p1,q1):Sn(pn,qn)]
S1
i1
send_req_serv
Sn
pn
p1
rec_req_1
o1
in
q1
rec_req_n
send_resp_1 send_resp_n
select_serv
qn
on
q
95-843: Service Oriented Architecture
Master of Information System
Management
An Example of Refinement
S1
i1
assess_claim
indemnity_customer
convoke_customer
o1
59
An Example of Refinement
i
S2
assess_simple_claim
i2
assess_simple_claim
assess_complex_claim
assess_complex_claims
indemnify_customer
convoke_customer
o2
Ref(S1,assess_claim,S2)
95-843: Service Oriented Architecture
Master of Information System
Management
60
c2
IP))
61
SM
c2
IP)
OCS || c2 IP
OCS
IP
rec_ord_pc
rec_ord_mon
send_ord_pr
rec_ord_pr
send_ord_mon
send_del_mon
rec_del_pr
send_del_pr
rec_del_mon
assemble_PC
o
95-843: Service Oriented Architecture
Master of Information System
Management
62
A Quiz
Describe this web service in words.
Ref(S1, assess_claim, [A1:An])
63
(1)
S=S
(2)
S=S
(3)
S1 S2 = S 2 S1
(4)
(5)
SS=S
(6)
(7)
(8)
64
(9)
S1 c S2 = S2 c S1
(10)
(11)
S = S
(12)
(13)
(S1 ) ~> S2 = S1 S2
(14)
(S1S2) ~> = S1 S2
(15)
65
{i1,,in} ={1,,n}
If Sj = then Si = Si
i=1
i=1,ij
Ref(S1,a,S2) = S1 if a L1(T1)
(16)
Si= Si
i=1
(17)
Dont select the
empty service.
If a is not an operation
then no refinement.
(18)
(19)
(20)
(21)
66
Example Proof
Prove: S1 S2 = S2 S1
S1 S2 = (S1 S2) (S2 S1)
(S1 S2) (S2 S1) = (S2 S1) (S1 S2) = S2 S1
67