52
Ace104 Ace104 Lecture 1 Lecture 1 Introduction Introduction Distributed Architectures Distributed Architectures SOA Concepts SOA Concepts

notes1.ppt

  • Upload
    zubin67

  • View
    855

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: notes1.ppt

Ace104Ace104Lecture 1Lecture 1

IntroductionIntroduction

Distributed ArchitecturesDistributed Architectures

SOA ConceptsSOA Concepts

Page 2: notes1.ppt

““Traditional” Traditional” programming modelsprogramming models

Page 3: notes1.ppt

Distributed programming models:Distributed programming models:Classic Web-basedClassic Web-based

Easy to deploy but slow, not great user experienceEasy to deploy but slow, not great user experience

htmlbrowser

WebServer

http

DynamicallyGenerated

html

Many programming models•JSP•ASP•Servlets•PHP•CGI (python, perl, C)•Cold Fusion

html

plus optionallyJavaScript to jazz up html

database

Lacks full supportof apps server -- notransactions, rpc, etc.

Page 4: notes1.ppt

Distributed programming modelsDistributed programming modelsTypical Web-basedTypical Web-based

Better user experience. Heavier, less portable, requires Better user experience. Heavier, less portable, requires socket programming to stream to server.socket programming to stream to server.

WebServer

http

DynamicallyGenerated

html

html + applet

databaseapplet

html

socket

Page 5: notes1.ppt

Direct ConnectionsDirect Connections

Direct socket and rpc-styleDirect socket and rpc-style

Application client

App1sockets

App2

App3

ports

Application client

App1

Remote ProceduresApp2

App3N

DS

Examples: Java’s rmi, CORBA, DCOM

Page 6: notes1.ppt

Application ServersApplication Servers

Page 7: notes1.ppt

RPC-style Web serviceRPC-style Web service

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 8: notes1.ppt

General role of XMLGeneral role of XML

Most modern languages have method of Most modern languages have method of representing structured data.representing structured data.

Typical flow of events in applicationTypical flow of events in application

Read data(file, db, socket)

Marshalobjects

Manipulate inprogram

Unmarshal (file, db, socket)

•Many language-specific technologies to reduce these steps: RMI, object serialization in any language, CORBA (actually somewhat language neutral), MPI, etc.

•XML provides a very appealing alternative that hits the sweet spot for many applications

Page 9: notes1.ppt

Simple XML-based architectureSimple XML-based architecture

webbrowser

WebServer

http

“hand-rolled”XML

XML

pyth

on C

GI

“hand-rolled”XML

File system

Page 10: notes1.ppt

Motivating Example1Motivating Example1

Mortgage CalculatorMortgage Calculator

Page 11: notes1.ppt

Example: mortgage calculatorExample: mortgage calculator

Start very simple to motivate role of XMLStart very simple to motivate role of XML

All we need is a web server that supports All we need is a web server that supports a server-side programming modela server-side programming model

We will build up this example to include We will build up this example to include first web service and then SOA concepts first web service and then SOA concepts (as we gain experience)(as we gain experience)

Page 12: notes1.ppt

Functional requirementsFunctional requirements

Design a simple application which does the Design a simple application which does the following:following: Accepts user inputAccepts user input

Loan amountLoan amountLoan termLoan termInterest rateInterest rateExtras (assessments + taxes)Extras (assessments + taxes)

Returns per-month table ofReturns per-month table oftotal paymenttotal paymentinterestinterestprincipalprincipalsome other fun stuffsome other fun stuff

Page 13: notes1.ppt

Design requirementsDesign requirements

Must beMust be Clean simple interface (easy)Clean simple interface (easy) Remotely accessible with securityRemotely accessible with security Portable to different machine architecturesPortable to different machine architectures Not require heavyweight or sophisticated Not require heavyweight or sophisticated

installation on the part of the userinstallation on the part of the user Sufficiently fast not to be embarrassing given Sufficiently fast not to be embarrassing given

10 hits/minute maximum usage10 hits/minute maximum usage

Page 14: notes1.ppt

Some possible architecturesSome possible architectures

Things I tried Things I tried what are (dis) advantages of each?what are (dis) advantages of each?

Web serverWeb server Server-side scripting with pure (dynamic) html Server-side scripting with pure (dynamic) html Server-side scripting with html+javascriptServer-side scripting with html+javascript Server-side scripting with html+appletServer-side scripting with html+applet

Direct connectionDirect connection Raw socketsRaw sockets Distributed objectsDistributed objects

Page 15: notes1.ppt

Initial choiceInitial choice

Front-end: html formFront-end: html form

Back end: python cgiBack end: python cgi Python generates web page dynamically after making Python generates web page dynamically after making

calculationscalculations No use of higher-level web generation libraries at this pointNo use of higher-level web generation libraries at this point

What are advantages/disadvantages of this architecture?What are advantages/disadvantages of this architecture?

Run application: Run application: http://people.cs.uchicago.edu/~asiegel/courses/ace104/lesson1/examples/mortgage/http://people.cs.uchicago.edu/~asiegel/courses/ace104/lesson1/examples/mortgage/

Page 16: notes1.ppt
Page 17: notes1.ppt
Page 18: notes1.ppt

DisadvantagesDisadvantages

Two obvious disadvantages are:Two obvious disadvantages are: Formatted web content in print statements low-level, Formatted web content in print statements low-level,

ugly error proneugly error prone Data is not decoupled from formatting. What if we want Data is not decoupled from formatting. What if we want

to switch to an application client? What if we want to to switch to an application client? What if we want to allow further processing by the client?allow further processing by the client?

Several strategies can help with both of these Several strategies can help with both of these (higher-level htmlgen libraries, server-side (higher-level htmlgen libraries, server-side scripting model, beans, etc.) and XMLscripting model, beans, etc.) and XML

We will look at how XML fits in We will look at how XML fits in

Page 19: notes1.ppt

Key QuestionsKey Questions

What does browser do with XML?What does browser do with XML? Can it display?Can it display? Does it even understand XML?Does it even understand XML?

If not, what good is this?If not, what good is this?

Do we have to hand roll our programming Do we have to hand roll our programming language objects from XML?language objects from XML?

Page 20: notes1.ppt

Some answersSome answers

Regarding first point, try this with your web Regarding first point, try this with your web browserbrowser Note that XML is displayed/formatted nicely, but not Note that XML is displayed/formatted nicely, but not

nearly to the same level of utility as the html tablenearly to the same level of utility as the html table To transform to html, we must associate a To transform to html, we must associate a

separate separate .xsl.xsl file (e.g.) with the XML file. We will study file (e.g.) with the XML file. We will study XSL soon.XSL soon.

Regarding XML-language conversion, we will Regarding XML-language conversion, we will study language binding for various high-level study language binding for various high-level ways of doing this. For now, we will hand-roll ways of doing this. For now, we will hand-roll ourselves!ourselves!

Page 21: notes1.ppt

Lottery applicationLottery application

Page 22: notes1.ppt

Functional requirementsFunctional requirements

Given a list of student members of a Given a list of student members of a dormitory, perform an ordered randomized dormitory, perform an ordered randomized sort of the students to determine a room sort of the students to determine a room draft order.draft order.

Page 23: notes1.ppt

Functional requirements, cont.Functional requirements, cont.

Students are defined byStudents are defined by Last nameLast name First nameFirst name SenioritySeniority

Quarters in the HouseQuarters in the HouseQuarters in the CollegeQuarters in the College

The sort keys areThe sort keys are1.1. Quarters in HouseQuarters in House2.2. Quarters in CollegeQuarters in College3.3. RandomRandom

Page 24: notes1.ppt

Software requirementsSoftware requirements

Secure loginSecure login House nameHouse name PasswordPassword

Remotely accessible to single small companyRemotely accessible to single small company Several hits per hour maximumSeveral hits per hour maximum

All Windows UsersAll Windows Users

What I triedWhat I tried ExcelExcel embedded in IE6 embedded in IE6 Web-basedWeb-based with java servlets, XML, XSLT with java servlets, XML, XSLT

Page 25: notes1.ppt

Sketch of XML/Servlet solutionSketch of XML/Servlet solution

XMLLoginInfo

XMLStudent

Data

filesystem

WebServer

login

lottery

WebClient

XML

XSLT

Page 26: notes1.ppt

Exercise 1Exercise 1

Page 27: notes1.ppt

An exercise1 solutionAn exercise1 solutionTravel Service

InternalRules

Engine

Security manager

WebClient html

WebClient

xml xml?

html

http

Complexity of marshaling/unmarshaling XMLHow to represent state

Ease of integration -- no proprietary issuesAbility to use Schema for validation

http

Page 28: notes1.ppt

SOA ConceptsSOA Concepts

A Very Brief IntroductionA Very Brief Introduction

Page 29: notes1.ppt

Standards OrganizationsStandards Organizations

W3CW3C (1994)(1994) OASISOASIS (1998) (1998) WS-IWS-I (2002) (2002)

membershipmembership 400400 600600 200200

Overall SOA-Overall SOA-specific goalsspecific goals

To further the To further the evolution of evolution of web via web via standards that standards that improve info improve info sharingsharing

To promote To promote online trade and online trade and commerce via commerce via specialized Web specialized Web services services standards standards

To foster To foster standardized standardized interoperability interoperability using Web using Web services services standardsstandards

Prominent Prominent SOA-specific SOA-specific deliverablesdeliverables

XML, XML XML, XML Schema, Xquery, Schema, Xquery, XML Encryption, XML Encryption, XML Signature, XML Signature, Xpath, XSLT, Xpath, XSLT, WSDL, SOAP, WSDL, SOAP, WS-CDL, WS-WS-CDL, WS-AddressingAddressing

UDDI, ebXML, UDDI, ebXML, SAML, XACML, SAML, XACML, WS-BPEL, WS-WS-BPEL, WS-SecuritySecurity

Basic Profile, Basic Profile, Basic Security Basic Security ProfileProfile

Page 30: notes1.ppt

This is all a work in progressThis is all a work in progress

Reading too much gives the impression that these are Reading too much gives the impression that these are turnkey solutions.turnkey solutions.

In fact, remember that MANY of these standards are In fact, remember that MANY of these standards are very immature and are at various stages of very immature and are at various stages of implementation by different vendors.implementation by different vendors.

They also tend to change quickly in the early years. Be They also tend to change quickly in the early years. Be very careful when applying to real problems!very careful when applying to real problems!

Question: are open standards worthwhile? If so, who do Question: are open standards worthwhile? If so, who do they benefit and how?they benefit and how?

Page 31: notes1.ppt

SOA DefinitionsSOA Definitions

What is a SOA?What is a SOA? OASIS: “OASIS: “paradigm for organizing and utilizing paradigm for organizing and utilizing

distributed capabilities that may be under the control distributed capabilities that may be under the control of different ownership domains. It provides a uniform of different ownership domains. It provides a uniform means to offer, discover, interact with and use means to offer, discover, interact with and use capabilities to produce desired effects consistent with capabilities to produce desired effects consistent with

measurable preconditions and expectationsmeasurable preconditions and expectations.”.”

Page 32: notes1.ppt

SOA definitions, cont.SOA definitions, cont.

Erl: “Erl: “Contemporary SOA represents an open, agile, extensible, Contemporary SOA represents an open, agile, extensible, federated, composable architecture comprised of autonomous, federated, composable architecture comprised of autonomous, QoS-capable, vendor diverse, interoperable, discoverable, and QoS-capable, vendor diverse, interoperable, discoverable, and potentially reusable services, implemented as Web services.potentially reusable services, implemented as Web services.

SOA can establish an abstraction of business logic and SOA can establish an abstraction of business logic and technology, resulting in a loose coupling between these technology, resulting in a loose coupling between these domains.domains.

SOA is an evolution of past platforms, preserving successful SOA is an evolution of past platforms, preserving successful characteristics of traditional architectures, and bringing with it characteristics of traditional architectures, and bringing with it distinct principles that foster service-orientation in support of a distinct principles that foster service-orientation in support of a service-oriented enterprise.service-oriented enterprise.

SOA is ideally standardized throughout an enterprise, but SOA is ideally standardized throughout an enterprise, but chieving this state requires a planned transition and the support chieving this state requires a planned transition and the support of a still evolving technology set.”of a still evolving technology set.”

Page 33: notes1.ppt

SOA Definitions, cont.SOA Definitions, cont.

OMGOMG: “: “Service Oriented Architecture is an architectural Service Oriented Architecture is an architectural style for a community of providers and consumers of style for a community of providers and consumers of services to achieve mutual value, that:services to achieve mutual value, that:

Allows participants in the communities to work together with Allows participants in the communities to work together with minimal co-dependence or technology dependence minimal co-dependence or technology dependence

Specifies the contracts to which organizations, people and Specifies the contracts to which organizations, people and technologies must adhere in order to participate in the technologies must adhere in order to participate in the communitycommunity

Provides for business value and business processes to be Provides for business value and business processes to be realized by the community realized by the community

Allows for a variety of technologies to be used to facilitate Allows for a variety of technologies to be used to facilitate interactions within the communityinteractions within the community””

Page 34: notes1.ppt

SOA definitions, cont.SOA definitions, cont.

W3C: “W3C: “A form of distributed systems architecture that is typically characterized by the A form of distributed systems architecture that is typically characterized by the following properties: following properties:

Logical viewLogical view: The service is an abstracted, logical view of actual programs, databases, business : The service is an abstracted, logical view of actual programs, databases, business processes, etc., defined in terms of what it does, typically carrying out a business-level processes, etc., defined in terms of what it does, typically carrying out a business-level operation. operation.

Message orientationMessage orientation: The service is formally defined in terms of the messages exchanged : The service is formally defined in terms of the messages exchanged between provider agents and requester agents, and not the properties of the agents between provider agents and requester agents, and not the properties of the agents themselves. The internal structure of an agent, including features such as its implementation themselves. The internal structure of an agent, including features such as its implementation language, process structure and even database structure, are deliberately abstracted away in language, process structure and even database structure, are deliberately abstracted away in the SOA: using the SOA discipline one does not and should not need to know how an agent the SOA: using the SOA discipline one does not and should not need to know how an agent implementing a service is constructed. A key benefit of this concerns so-called legacy systems. implementing a service is constructed. A key benefit of this concerns so-called legacy systems. By avoiding any knowledge of the internal structure of an agent, one can incorporate any By avoiding any knowledge of the internal structure of an agent, one can incorporate any software component or application that can be "wrapped" in message handling code that allows software component or application that can be "wrapped" in message handling code that allows it to adhere to the formal service definition. it to adhere to the formal service definition.

Description orientationDescription orientation: A service is described by machine-processable meta data. The : A service is described by machine-processable meta data. The description supports the public nature of the SOA: only those details that are exposed to the description supports the public nature of the SOA: only those details that are exposed to the public and important for the use of the service should be included in the description. The public and important for the use of the service should be included in the description. The semantics of a service should be documented, either directly or indirectly, by its description. semantics of a service should be documented, either directly or indirectly, by its description.

GranularityGranularity: Services tend to use a small number of operations with relatively large and complex : Services tend to use a small number of operations with relatively large and complex messages. Network orientation: Services tend to be oriented toward use over a network, though messages. Network orientation: Services tend to be oriented toward use over a network, though this is not an absolute requirement. Platform neutral: Messages are sent in a platform-neutral, this is not an absolute requirement. Platform neutral: Messages are sent in a platform-neutral, standardized format delivered through the interfaces. XML is the most obvious format that standardized format delivered through the interfaces. XML is the most obvious format that meets this constraint. “meets this constraint. “

Page 35: notes1.ppt

SOA definition, cont.SOA definition, cont.

Open GroupOpen Group: “An architectural style that supports service orientation …: “An architectural style that supports service orientation …

Service orientation Service orientation A way of a way of thinking in terms of services and service based development and the outcomes A way of a way of thinking in terms of services and service based development and the outcomes that services bring Service that services bring Service A logical representation of a repeatable business activity that has a specified outcome (e.g., A logical representation of a repeatable business activity that has a specified outcome (e.g., check customer credit; provide weather data, consolidate drilling reports), is self-contained and check customer credit; provide weather data, consolidate drilling reports), is self-contained and maybe composed of other Services. It is a black box to consumers of the Service Architectural maybe composed of other Services. It is a black box to consumers of the Service Architectural Style Style The combination of distinctive features in which Enterprise Architecture is done, or expressed The combination of distinctive features in which Enterprise Architecture is done, or expressed The SOA Architectural styleThe SOA Architectural style ユユ ss distinctive features: Based on the design of the services distinctive features: Based on the design of the services comprising an enterprisecomprising an enterprise’’ss (or inter-enterprise) business processes. Services mirror real-world (or inter-enterprise) business processes. Services mirror real-world business activity business activity

Service representation utilizes business descriptions. Service representation requires providing its Service representation utilizes business descriptions. Service representation requires providing its context (including business process, goal, rule, policy, service interface and service component) context (including business process, goal, rule, policy, service interface and service component) and service orchestration to implement service Has unique requirements on infrastructure. and service orchestration to implement service Has unique requirements on infrastructure. Implementations are recommended to use open standards, realize interoperability and location Implementations are recommended to use open standards, realize interoperability and location transparency. Implementations are environment specific, they are constrained or enabled by transparency. Implementations are environment specific, they are constrained or enabled by context and must be described within their context. Requires strong governance of service context and must be described within their context. Requires strong governance of service representation and implementation Requires a representation and implementation Requires a LLitmus Test, which determined a itmus Test, which determined a ggood services”ood services”

Page 36: notes1.ppt

SOA: the basicsSOA: the basics

What it is.What it is.

What it is not.What it is not.

Page 37: notes1.ppt

Real SOAReal SOA

Changed mindset: service-oriented Changed mindset: service-oriented context for business logic.context for business logic.

Changed automation logic: service-Changed automation logic: service-oriented applications.oriented applications.

Changed infrastructure: service-oriented Changed infrastructure: service-oriented technologies.technologies.

A top-down organization transformation A top-down organization transformation requiring real commitment.requiring real commitment.

Page 38: notes1.ppt

SOA CharacteristicsSOA Characteristics

Loosely coupled: minimizes dependencies Loosely coupled: minimizes dependencies between services.between services.

Contractual: adhere to agreement on Contractual: adhere to agreement on service descriptions.service descriptions.

Autonomous: control the business logic Autonomous: control the business logic they encapsulate.they encapsulate.

Abstract: hide the business logic from the Abstract: hide the business logic from the service consumers.service consumers.

Page 39: notes1.ppt

SOA CharacteristicsSOA Characteristics

Reusable: divide business logic into Reusable: divide business logic into reusable services.reusable services.Composable: facilitate the assembly of Composable: facilitate the assembly of composite services.composite services.Stateless: minimize retained information Stateless: minimize retained information specific to an activity.specific to an activity.Discoverable: self-described so that they Discoverable: self-described so that they can be found and assessed.can be found and assessed.

Page 40: notes1.ppt

Potential BenefitsPotential Benefits

Based on open standards.Based on open standards.

Supports vendor diversity.Supports vendor diversity.

Fosters intrinsic interoperability.Fosters intrinsic interoperability.

Promotes discovery.Promotes discovery.

Promotes federation.Promotes federation.

Fosters inherent reusability.Fosters inherent reusability.

Emphasizes extensibility.Emphasizes extensibility.

Page 41: notes1.ppt

Potential BenefitsPotential Benefits

Promotes organizational agility.Promotes organizational agility.

Supports incremental implementation.Supports incremental implementation.

Technical architecture that adheres to and Technical architecture that adheres to and supports the principles of service supports the principles of service orientation.orientation.

Page 42: notes1.ppt

Bu

sin

ess

lo

gic

Focus on the Business– Process Focus on the Business– Process and Servicesand Services

Applicationa

Applicationc

Applicationb

Ap

plic

atio

nlo

gic

Source: Service-Oriented Architecture, Thomas Erl

Page 43: notes1.ppt

Ap

plic

atio

n la

yer

Se

rvic

es

inte

rfa

ce la

yer

Bu

sin

ess

p

roce

ss la

yer

Application-oriented services

Business-oriented services

Focus on the Business– Process Focus on the Business– Process and Servicesand Services

.NET J2EE Legacy

Source: Service-Oriented Architecture, Thomas Erl

Page 44: notes1.ppt

Ap

plic

atio

n la

yer

Se

rvic

es

inte

rfa

ce la

yer

Bu

sin

ess

p

roce

ss la

yer

Focus on the Business– Process Focus on the Business– Process and Servicesand Services

.NET J2EE Legacy

Source: Service-Oriented Architecture, Thomas Erl

orchestration service layer

business service layer

application service layer

Page 45: notes1.ppt

SOA hypeSOA hype

Beware that SOA is used in many different ways within Beware that SOA is used in many different ways within the IT community (“most despised buzzword according the IT community (“most despised buzzword according to several surveys”)to several surveys”)

Erl-1 does a good job of sorting through a lot of this -- Erl-1 does a good job of sorting through a lot of this -- should read ch. 1-3 carefully. should read ch. 1-3 carefully.

Still, many attributes ascribed to SOA are carryovers Still, many attributes ascribed to SOA are carryovers from the “old days” -- encapsulation of business logic, from the “old days” -- encapsulation of business logic, language interoperability, network transparency, loose language interoperability, network transparency, loose coupling, etc. etc. What is new?coupling, etc. etc. What is new?

Page 46: notes1.ppt

BPELBPEL

BPEL is a key part of the Web Services activitiesBPEL is a key part of the Web Services activities BPEL 2.0 called BPEL 2.0 called WS-BPELWS-BPEL

BPEL is a programming language specialized for BPEL is a programming language specialized for creating/executing a workflow of assembled web services creating/executing a workflow of assembled web services (think driver language).(think driver language).

BPEL is built on top of a number of XML-related BPEL is built on top of a number of XML-related specificationsspecifications

XMLXML is used as the syntax for BPEL is used as the syntax for BPELWSDLWSDL is used as the interface description of Web Services is used as the interface description of Web ServicesXMLXML Schema is used to describe the types used by BPEL Schema is used to describe the types used by BPEL processesprocessesXPathXPath is used to extract parts of data in a BPEL process is used to extract parts of data in a BPEL process

Page 47: notes1.ppt

SOA vs. Web servicesSOA vs. Web services

SOA design concepts exist independently of web SOA design concepts exist independently of web services -- web services are one (and currently the services -- web services are one (and currently the only) standard upon which SOA designs can be only) standard upon which SOA designs can be built and deployed. This is a pretty uniformly built and deployed. This is a pretty uniformly accepted view.accepted view.

By the same token, using web services does not By the same token, using web services does not necessarily imply SOA designnecessarily imply SOA design

That said, in real world modern SOA the two That said, in real world modern SOA the two technologies are tightly linked and go hand in handtechnologies are tightly linked and go hand in hand

Page 48: notes1.ppt

BPEL and BPMNBPEL and BPMN

There is no standardized graphical There is no standardized graphical notation for BPELnotation for BPEL XML is used as the standardized syntaxXML is used as the standardized syntax the BPEL syntax is defined by an XML Schemathe BPEL syntax is defined by an XML Schema most BPEL tools provide graphical notationsmost BPEL tools provide graphical notations different products use different notationsdifferent products use different notations Business Process Modeling Notation (BPMN)Business Process Modeling Notation (BPMN) has has

been proposed as a graphical notation standardbeen proposed as a graphical notation standard

Page 49: notes1.ppt

Some perspectiveSome perspective

Think about and try to articulate the relationship Think about and try to articulate the relationship between SOA and other common programming between SOA and other common programming modelsmodels StructuredStructured OO OO Component-based Component-based Distributed Distributed Client-server programmingClient-server programming

Confluence of many existing ideas, but SOA is Confluence of many existing ideas, but SOA is definitely a shift in perspective (if not a radically new definitely a shift in perspective (if not a radically new paradigm).paradigm).

Page 50: notes1.ppt

Exercise 2Exercise 2

Page 51: notes1.ppt

Organization of BookOrganization of Book

Web Services and “Primitive SOA”Web Services and “Primitive SOA” Services (as web services)Services (as web services) Service descriptions (WSDL)Service descriptions (WSDL) Messaging (SOAP)Messaging (SOAP)

Web Services and “Contemporary SOA”Web Services and “Contemporary SOA” Part I: MEPs, service activity, atomicity, business activities, Part I: MEPs, service activity, atomicity, business activities,

orchestration, choreographyorchestration, choreography Part II: Advanced messaging, metadata, and securityPart II: Advanced messaging, metadata, and security

We will roughly follow this ordering but precede it with a deep We will roughly follow this ordering but precede it with a deep understanding of XML, Schema …understanding of XML, Schema …

This will be topic of next lectureThis will be topic of next lecture

Page 52: notes1.ppt

QuizQuiz