710 likes | 771 Views
Service Oriented Architecture. Lecture 1: Introduction. Plan for the week. Course Introduction Some principles and definitions Some Theory Technology Foundations Homework 1 Getting logged on to Oracle ’ s SOA Suite. Course Web Site. http://www.andrew.cmu.edu/~mm6.
E N D
Service Oriented Architecture Lecture 1: Introduction Master of Information System Management
Plan for the week Course Introduction Some principles and definitions Some Theory Technology Foundations Homework 1 Getting logged on to Oracle’s SOA Suite Master of Information System Management
Course Web Site • http://www.andrew.cmu.edu/~mm6 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. Master of Information System Management
Structure of the Course • Lectures/class participation • Homework (pencil and paper and programming) • Midterm exam • Readings from IBM’s High level reference architecture will be assigned. • Reading from the required course text and the web will be assigned. • Presentations • Final examination Master of Information System Management
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”. Master of Information System Management
What is architecture? Victorian Gothic or Neo-Gothic architecture Master of Information System Management
Victorian Free Classical style Adelaide Town Hall Master of Information System Management
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. Master of Information System Management
Why is SOA Different? (1) Terminology: Both IT people and business people know what a service is. (2) Interoperability: The interfaces and the wire protocols are based on standards. (3) Extension and Evolution not rip and replace. (4) Reuse of both functionality and machine resources. Chapter one of Reynolds Master of Information System Management
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 re-configurable end-to-end business process realization using interface-based service descriptions.”From a paper by Borges, Holley and Arsanjani. Master of Information System Management
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 Master of Information System Management
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 Master of Information System Management
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 Master of Information System Management
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 Master of Information System Management
Build an SOA in 8 Steps • 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 Plummer of Gartner. Master of Information System Management
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. Master of Information System Management
Build an SOA in 8 Steps (5) Secure the services. Using established standards, we need privacy, identification, authentication, and authorization. This may need to be federated security (over more than one organization.) Master of Information System Management
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. Master of Information System Management
Objectives of This Course • Study Foundations of SOA Mathematical models (Petri nets) Important standards Orchestration and Choreography The Enterprise Service Bus Reference Architectures Enterprise Integration Patterns (2) Get hands on experience with Oracle’s SOA Suite of tools. Master of Information System Management
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! Master of Information System Management
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. Master of Information System Management
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). Master of Information System Management
Petri Nets Places are typically drawn as circles and transitions as bars. t1 p1 p2 t3 p3 t2 p4 Master of Information System Management
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)} t1 p1 p2 t3 p3 t2 p4 Master of Information System Management
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. ** t1 p2 p1 t3 * * t2 p3 p4 Master of Information System Management
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. Master of Information System Management
Fire Transition t1 (ready?) ** t1 p2 p1 t3 * * t2 p3 p4 Master of Information System Management
Transition t1 Fired * * t1 p2 p1 t3 * t2 p3 p4 Master of Information System Management
Fire Transition t3 (Ready?) * * t1 p2 p1 t3 * t2 p3 p4 Master of Information System Management
Transition t3 Fired * t1 p2 p1 t3 t2 p3 p4 Master of Information System Management
Petri Nets Consider again the following program: a = 1; b = 2; c = 3; a = a + 1; c = b + c; b = a + c; Master of Information System Management
Modeled as a Petri Net a=1 a=a+1 * p1 p4 b=a+c b=2 p7 * c=b+c p5 p9 p2 c=3 * p8 p6 p3 Master of Information System Management
Fire Transitions (ready?) a=1 a=a+1 * p1 p4 b=a+c b=2 p7 * c=b+c p5 p9 p2 c=3 * p8 p6 p3 Master of Information System Management
Transitions Fired a=1 a=a+1 * p1 p4 b=a+c b=2 * p7 c=b+c p5 p9 p2 c=3 * p8 p6 p3 Master of Information System Management
Fire Transitions (Ready) a=1 a=a+1 * p1 p4 b=a+c b=2 * p7 c=b+c p5 p9 p2 c=3 * p8 p6 p3 Master of Information System Management
Transitions Fired a=1 a=a+1 p1 p4 * b=a+c b=2 p7 c=b+c p5 p9 p2 * c=3 p8 p6 p3 Master of Information System Management
Fire Last Transition (Ready?) a=1 a=a+1 p1 p4 * b=a+c b=2 p7 c=b+c p5 p9 p2 * c=3 p8 p6 p3 Master of Information System Management
Last Transition Fired a=1 a=a+1 p1 p4 b=a+c b=2 p7 * c=b+c p5 p9 p2 c=3 p8 p6 p3 Master of Information System Management
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. Master of Information System Management
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? Master of Information System Management
Two Quizzes (Take out pencil and paper) (1) The Petri Net we drew begins with three markings. Redraw the Petri net so that it begins with a single marking. (2) Build a Petri net to wash a lion based on the following steps. 1. Get lion. 2. Get soap. (real soap not SOAP) 3. Get tub. 4. Put water in tub. 5. Put lion in tub. 6. Wash lion with soap. 7. Rinse lion. 8. Remove lion from tub. 9. Dry lion. Master of Information System Management
Liveness A Petri net is deadlockedif 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. Master of Information System Management
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. Master of Information System Management
D available * Request D Request D D ready D ready Finished with D and P Finished with D and P Process Release D and P Process Release D and P P ready P ready Request P Request P P available * Person 1 Person 2 Master of Information System Management
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 Master of Information System Management Master of Information System Management
Petri Nets Service Algebra Petri Nets may be represented with an algebra: S :: The service that does nothing X A basic service S1 S2 S1followed by S2 Sequence operator S1 S2 S1 xor S2 S1◊ S2 arbitrary sequence µS iteration on S S1c 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 with other operations. Master of Information System Management
The Empty Service P * Master of Information System Management
Service S1 S1 * i1 : : : : o1 Master of Information System Management
Service S2 S2 * i2 : : : : o2 Master of Information System Management