• Nenhum resultado encontrado

MinicursoSOA[JorgeDias]

N/A
N/A
Protected

Academic year: 2021

Share "MinicursoSOA[JorgeDias]"

Copied!
32
0
0

Texto

(1)

Service-Oriented

Architecture

Jorge Dias Jr.

RiSE (www.rise.com.br) December 2007

Agenda



Evolution



SOA Introduction



Web Services



SOA and Quality Attributes



SOA Methodologies



SOA and BPM



BPMN (Business Process Modeling Notation)



Past, Present and Future of SOA

SOA



What is this?



A set of technologies?



A methodology?



An architectural pattern?



What else?

“By 2008, SOA will provide the basis for 80

percent of development projects” [Gartner]

“The problem is that you can’t just buy SOA;

you have to understand it and live it. SOA

is a paradigm. SOA is a way of thinking.

SOA is a value system for architecture and

(2)

Evolution



Physical Evolution



Logical Evolution (Paradigm Evolution)



Business Computing Evolution

Evolution



Physical Evolution

Client BusinessLogic Data Client BusinessLogic Data

Protocol Client Business Logic Data Prot ocol Business Logic Protoc ol BusinessLogic Protocol Protocol Data Protocol Monolithic Client/server N-tier

Evolution



Logical Evolution (Paradigm Evolution)



We have progressed from modules, to

objects, to components, and now to

services

1970s 1980s 1990s Early 2000s TODAY Reuse through function-oriented programming (sub-routine and function reuse Reuse through object-oriented programming (class reuse) Reuse through distributed object technologies and component based architectures (CORBA/DCOM/ DCE and component reuse

Reuse through early service orientation (reuse of web services) Service-Oriented Architectures (SOA) ▼ ▼ ▼ ▼ ▼

Evolution



Logical Evolution (Paradigm Evolution)

Object Object Object Component Object Object Object Component Service Object Object Object Component Object Object Object Component Service

(3)

Evolution



Service-Oriented Architecture

Evolution of object-orientationandcomponent-basedparadigm [Szyperski, 2002][McCoy et al., 2003]

Inter-enterprise Inter-application Intra-application Intra-application Communication scope Runtime Compile-time Compile-time Compile-time Dependencies Very Loose Loose Tight Tight Coupling High Medium Low Low Reusability Published Public Private/public Defined Contract Coarse Medium Fine Very fine Granularity Service-based development Component-based development Object-oriented development Structured development [McGovern, 2003]

Evolution



Business Computing Evolution

Dep A Application A Dep B Application B Dep C Application C Dep D Application D

Evolution



Business Computing Evolution

Company DBMS Application A Application B Application C Application D Dep A Dep B Dep C Dep D

Evolution



Business Computing Evolution

Applications Services

(4)

SOA Introduction

Service-Oriented Architecture



SOA has specific characteristics that turns

its a

new paradigm



SOA is the ideal solution for very special

circumstances:

heterogeneous

distributed

systems with

different owners



Find, bind and execute

” approach

Service-Oriented Architecture



Specific kind of software architecture

Software Architecture

Service-Oriented Architecture

Web Services Jini CORBA

implements

Service-Oriented Architecture



Definition



Several definitions



Many of definitions come from

vendors

and

are linked to the products they have to sell

[Jones, 2006]

(5)

Service-Oriented Architecture



Definition



SOA is a

software architecture

that is based

on the key concepts of an application

front-end, service, service repository, and service

bus. A service consists of a

contract

, one or

more

interfaces

, and an

implementation

[Krafzig et al., 2004].

Service-Oriented Architecture



Definition



A paradigm for organizing and utilizing

distributed capabilities

that may be under the

control of different

ownership domains

. It

provides a uniform means to offer, discover,

interact with and use capabilities to produce

desired effects consistent with measurable

preconditions and expectations [OASIS, 2006]

Service-Oriented Architecture



SOA Benefits

Better reuse

Build new client functionality on top of existing Business Services

Interoperability

Contract-based interfaces

Well defined interfaces

Make changes without affecting clients

Easier to maintain

Increased Organizational Agility

Better flexibility

Service-Oriented Architecture



SOA Roles

Service Consumer Service Provider Contract Service Registry B in d a n d e x e c u te Find Regis ter

(6)

Service-Oriented Architecture



Common misperceptions about SOA

“An application that uses Web services is service-oriented.”

“SOA is just a marketing term used to re-brand Web services.”

“If you understand Web services you won't have a problem building SOA.”

“Once you go SOA, everything becomes interoperable.”

“Only Web services can be used to implement SOA.”

Service-Oriented Architecture



Service-orientation principles

[Erl, 2005]



Services are

reusable



Services share a

formal contract



Services are

loosely coupled



Services abstract

underlying logic



Services are

composable



Services are

autonomous



Services are

stateless



Services are

discoverable

Service-Oriented Architecture



SOA Ingredients

Infrastructure

Enterprise Service Bus (ESB)

Architecture

Types of services, amount of loose coupling, data model, service interfaces, policies, rules and patterns

Processes

Business Process Modeling

Service lifecycle Governance

Service



Services represent

business

functionality



A well-defined

interface

(7)

Service



Kinds of service



Task-centric Services



Entity Services



Application Services



Infrastructure Services

Security, etc.

Enterprise Service Bus



Works as a

middleware



Solves distributed system problems



Supports at least one form of

communication



publish/subscribe, request/response,

one-way, etc.



Supports

multiple transport

protocols



HTTP, JMS,…



Consumer

does not invoke directly

the

provider interface

Enterprise Service Bus

(8)

Web Services

"

A Web service is a software application

identified by a URI

, whose interface and

bindings are capable of being

identified

,

described

and

discovered

by XML artifacts and

supports direct interactions with other software

applications using

XML based messages

via

Internet-based protocols

."

[World Wide Web Consortium]

Web Services

Characteristics



There is not revolucionary neither exceptional

Technology simple!!



Set of

standarlized

technologies

Data format

Communication



Descriptions

based on XML

Middleware independent of platform and programming language

Easy communication through firewalls

Web Services

Web Services

Use Scenarios



Development of distributed applications

based on Web



Development of process-oriented

applications



Systems integration



Different operational system



Different programming language

(9)

Web Services

Web Services Architecture

Architecture Based on Roles:

-

Service provider: Web service supplier, who

implements and dispose the services.

-

Service requestor: Web Service consumer,

which uses a network connection and sends a

XML Request.

-

Service registry: Centralized services

repository, which the providers publish the

services.

Web Services Architecture

Architecture Based on Roles:

Service Requestor Service Registry Service Provider

Bind the service

Find the serv ice Pu blish the serv ice 1 2 3

Web Services Architecture

Architecture based on protocol stack

- Transport service: HTTP, SMTP, FTP, JMS.

- XML messaging: Layer responsible for coding the

messages on common XML format. Ex: XML-RPC e SOAP.

- Service description: Responsible for describing the

public interfaces of Web service. Ex: WSDL.

- Service discovery: Supplies facility for search and

(10)

Web Services Architecture

Architecture based on protocol stack

Discovery (UDDI) Description (WSDL) XML Messaging (XML-RPC, SOAP, XML) Transport (HTTP, SMTP, FTP, BEEP)

Web Services

SOAP

SOAP



Communication protocol among Web services

(W3C standard)



Defines the messages format changed among

Web services



Based on XML-RPC, with several evolutions



Independent of platform and programming

language



The communication can be realized by several

protocols, such as HTTP, SMTP, FTP, JMS, and

so on

(11)

SOAP

SOAP Format

SOAP Message Envelope (mandatory) Header (optional) Body (mandatory) Fault (optional)

SOAP



SOAP Request

SOAP



SOAP Response

SOAP



Envelope

- SOAP-ENV:Envelope

- Version controled by namespace.

Version 1.1 <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/> Version 1.2 <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://www.w3.org/2001/09/soap-envelope>

(12)

SOAP



Header

SOAP-ENV:Header

Generally it is processed by server side

The header format is not defined by specification to able flexibility for applications

It can be implemented authentication, transaction control, logging, etc.

Two attributes within header can be used:

SOAP-ENV:mustUnderstand when has value “1” obliges to the other side to handle the header, otherwise an error is thrown.

SOAP-ENV:actor is used to chain other Web services to end the processing.

SOAP



Header

<SOAP-ENV:Header>

<myNS:authentication

xmlns:myNS=http://www.stevepotts.com/auth

SOAP-ENV:mustUnderstand=“1”>

<login> admin </login>

<password> 123456 </password>

</myNS:authentication>

</SOAP-ENV:Header>

SOAP



Body

- SOAP-ENV:Body

- In this element where the payload of

SOAP message is put.

- It can be a method invocation, a XML

document or only a request with any

information.

SOAP



Fault

- SOAP-ENV:fault

- It indicates that a problem occurred in the

attempt of the processing of the request

sent to the Web service.

(13)

SOAP



Fault

Description Element name

This element should contain the maximum one of possible information about the state of the server in the moment of the fault.

detail

This optional element informs that service generated the fault.

faultActor

This element is a legible version for the man of the faultcode.

faultString

This element is required by the specification. It should have some code indicating what is the problem. faultcode

SOAP



Fault

Error generated when an element in the head cannot be processed and that element is marked as mandatory

SOAP-ENV:mustUnderstand

It occurs when versions of the processors SOAP of the client and of the server are different.

SOAP-ENV:versionMismatch

It indicates that some error happened with the message of the client.

SOAP-ENV:Client

An error occurred in the server upon treating the request of the client.

SOAP-ENV:Server

Description Faultcode type

SOAP



Datatypes

<nMat xsi:type=“xsd:string”> 10211013 </nMat>



Datatypes permitted:

Scalar types: int, double, string,... Structure types: array, structures.

SOAP

(14)

SOAP



SOAP via HTTP: Response

Web Services

WSDL

(Web Services Description Language)

WSDL



Represents the contract between the service

provider and the service consumer



Describes the services through of XML

specification



It is equivalent to the specification of IDL

interface of CORBA or DCOM



Describes:

Interface information

Datatype information for request and response messages

Transport protocol to be used

Information for the location of specific service

WSDL

WSDL Specification



Abstract part



types



message



portType



Concrete part



binding



service

(15)

WSDL

<types>: What datatypes will be transmitted

<message>: Which messages will be transmitted

<portType>: Which operations will be supported

<binding>: How the messages will be transmitted

<service>: Where the services will be localized

<definitions>: Root element of WSDL

WSDL



definitions



message

WSDL



portType



Four types of operations are permitted:

One-way Request-response Solicit-response Notification

WSDL



portType

(16)

WSDL



binding



service

Web Services

UDDI

(Universal Description, Discovery and Integration)

UDDI

 Technical specification to describe, find and integrate Web services

 Developed by Ariba, IBM and Microsoft in Set/2000

 It is the registry provider of Web services

 It stores the specifications WSDL of the service providers

 It permits that clients find the service providers that they need and discovery how to request these services

 It makes the role of RMI registry and name services of CORBA trading

 At this moment UDDI is in version 3.0

UDDI

Characteristics



Registered Interfaces are described in WSDL



Records are stored in XML



It receives requests of registry and discovery

using the SOAP protocol



Companies can have their own private UDDI

servers for registering of internal services



It differs of a repository by do not possess the

(17)

UDDI

Service Searches

White pages: Provides the address to

contact the service provider.

Yellow pages: Classifies the providers in

categories according to their business

area.

Green pages: Provides technical

informations about the services.

UDDI

UDDI architecture:



UDDI Data model: XML schema to

describe the business of Web services.



UDDI API: API based on SOAP to publish

and search UDDI data.



UDDI cloud services: sites that provides

implementations of UDDI specifications.

Ex: IBM e Microsoft.

UDDI



The record has 4 information:



Business Entity

Unique identifier, Business name, Information for contact,

Business description,

List of categories that describes and classifies the business

A URL for more information about the business

UDDI



Business Service

Service description

List of category that describes the service

URL for more information about the service



Specification pointers

Associated with each business service entry is a

list of binding templates that point to specifications and other technical information about the service.

For example, a binding template might point to a

URL that supplies information on how to invoke the service.

(18)

UDDI



Service types

A technical model (tModel) defines a service type Multiple business can offer the same service type

defined by tModel

A tModel contains information contained in service,

such as

tModel name,

Organization name that creates the tModel,

Categories that defines the service type,

Pointers for specifications of service type, including

interface definition, message format, security, etc.

UDDI



UDDI has 5 structures

publisherAssertion

Describes the relationship between two partnerships

businessEntity

Contains information about the provider

businessService

Describes the different kind of services provided by a

provider

bindingTemplate

Contains technical informatio about the services tModel

Categorizes the services

UDDI

UDDI

(19)

UDDI



UDDI

Publishing

API

UDDI

Implementações



Java

- UDDI4J

- jUDDI



Microsoft COM

- UDDI SDK



Pearl

- SOAP::Lite

Web Services

Example

Example



Framework



Axis (Apache) – runs over Tomcat



Provider language



Java



Client language



Java

(20)

Service Provider

public class Calculator {

public int somar(int numA, int numB) {

return numA+numB; }

public int subtrair(int numA, int numB) { return numA-numB; } }

Service Provider



Deploy



Automatically over JWS

Rename .java to .jws 

Manually over WSDD

Create a description file .wsdd Deploy with ‘deploy’ command

Service Client



Automatically



Generate the stubs with WSDL

wsdl2Java



Manually

(21)

Service Client – Automatically

(Java)

Service Client (PHP)

<?php

require_once('nusoap.php');

$param = array('numA'=>'2', 'numB'=>'3');

$serverpath ='http://services.xmethods.net:80/soap/servlet/rpcrouter'; $client = new soapclient($serverpath);

$soma = $client->call('somar',$param); if (isset($fault)) {

print "Error: ". $fault; }

else {

print "Resultado: ". $soma; } // kill object unset($client); ?>

Frameworks



AXIS (Apache)



GLUE



JWSDP (Sun)



Microsoft Web Services



XFire



J2ME



kSOAP



kXML

WS Specifications



Web Services Interoperability Organization

(WS-I) was chartered in 2002

Develops profiles

Suggests best practices

Provides testing tools



Examples

WS-Security

WS-Policy

WS-Reliability

(22)

WS-Security



Specified by Microsoft, IBM and VeriSign

in 2002 and adopted by OASIS



Defines an extension for Header of SOAP



Aims to resolve the SSL problems related

to message exchanges



Sign only specific portions of XML



Uses other two standards of W3C



XML-Signature



XML-Encryption

WS-Security

SOA and Quality Attributes

SOA and Quality Attributes



Interoperability



Performance

Decreases the performance

Service discovery Overhead of SOAP Solutions Load balancing Stateful services 

Security

HTTPS (network level)

(23)

SOA and Quality Attributes



Reliability

Consumers have different requirements about reliability

Related to transport protocol

HTTPR, MOM, ...

WS-Reliability

Replication



Location Transparency

UDDI, P2P

Impact positevely and negatively on peformance

SOA and Quality Attributes



Availability

Service-Level Agreements (SLAs)

Replication



Scalability

Horizontal scaling

add new hardware, making load-balancing

Vertical scaling

upgrade the hardware, increasing the capacity of a server Grid Computing and P2P

SOA and Quality Attributes



Testability



Black-box approach



Services can be composed by other services,

running in several machines with different

contexts



Services may be discovered at runtime



Development tools try to protect developers

from the task of dealing with XML-based

standards of Web Services

SOA and Quality Attributes



Reusability



Service repository (UDDI?)



Such as CBD approach, reusable services

should be carefully specified, designed,

implemented, and documented

(24)

SOA Methodologies

SOA Methodologies



SOA Delivery Lifecycle [Erl, 2005]

SOA Methodologies



SOUP (Service-Oriented Unified Process)

Service-Oriented Design



Service-oriented modeling requires additional

activities and artifacts that are not found in

traditional object-oriented analysis and design

[Arsanjani, 2004]



Methods

SOMA (IBM)

(25)

Service-Oriented Design



Approaches

Erl’s Approach

Erl’s Approach

Erl’s Approach



Analysis phase

 Define business requirements: The business

requirements related to scope of the solution are collected to begin the analysis process.

 Identify automation systems: Existing application

logic that already attends some requirements identified in step 1 needs to be identified.

 Model candidate services: The concept of service

modeling process is introduced. The service operation candidates are identified and then grouped into a logical context.

(26)

Erl’s Approach



Model Candidate Services

Decompose the business process Business process models Identify business service operation candidates Abstract orchestration logic Operation candidates Create business service candidates

Refine and apply principles of service-orientation Identify candidate service compositions Revise business service operation grouping Analyze application processing requirements Identify application service operation candidates Create application service candidates Revise candidate service compositions Revise application service operation grouping Business Service Candidates Business Service Candidates Service compositions Service candidates model Processing requirements Application service operation candidates Application service candidates

Erl’s Approach



Design phase



Compose SOA



Design services

Entity-centric business service design process Application service design process

Task-centric business service design process



Design service-oriented business process

SOA and BPM

SOA and BPM



BPM will become the driver for SOA

implementation [Gartner]



Combining BPM and SOA will help

creating services that can be reused

throughout the organization

(27)

Service-Oriented Architecture



Good way to build

business applications



Business process

in its entirety can be viewed

and modeled as a

service

[Erl, 2005]

Service Reuse

Business Process Reuse

SOA and BPM



BPM Ingredients



Process design

Captures existent processes Using of visual tools



Process execution

Manages the operational execution of the

processes

"Run what I just drew!"



Process monitoring

Examines the status of the execution and statistics

SOA and BPM

SOA and BPM

(28)

Service-Oriented Architecture



SOA and

Business

Process

[Havey, 2005]

BPMN

Business Process Modeling Notation

BPMN

 Proposed by BPMI (Business Process Management

Initiative)

 Fusion between BPMI and OMG to improve efforts in business process field

 Combination of the best ideas in unique diagram

 Easy comprehension among stakeholders: consumers, process analystis, developers, etc.

 Designed to overcome the distance between processo modeling and implementation

 Mapping to execution languages

BPML (Business Process Modeling Language)

BPEL4WS (Business Process Execution Language for

BPMN



Formation of Notation Working Group

August 2001: Formation of Working group

58 members representing 35 organizations



BPMN 0.9 Draft

November 2002: draft specification 0.9 is published to the public



BPMN 1.0 Draft

August 2003: draft specification 1.0 is published to the public



BPMN 1.0 Final

(29)

BPMN



The notation is grouped in following:



Flow objects

Show the activities and the execution flows



Connection objects

Connect the flow objects



Swimlanes (Pool)

Usually is associated to the departaments or

groups



Artifacts

Used to complement (comments)

BPMN – Flow Objects



Events



Something that occurs on the business

process

Begin of process Intermediate event End of process

BPMN – Flow Objects



Events

BPMN – Flow Objects



Events

Example 1 Example 2

(30)

BPMN – Flow Objects



Activities

Subdivides in processes, subprocesses and tasks

BPMN – Flow Objects



Gateways



Used as structures of flow control

BPMN – Flow Objects



Gateways

BPMN – Swimlane



Group the activities considering functional

aspects or responsability (profile or entities)

Lane

Lane

Po

o

(31)

BPMN – Connection Objects



Associations, sequence flows and

message flows

BPMN

Past, Present and Future of SOA

Past, Present and Future

(32)

Past, Present and Future



Books

Past, Present and Future



What is being researching?



Research foccusing on the infrastructure, and

network and distributed system issues



Lack of research in software engineering

related to SOA

First Modeling, Design, and Analysis for

Service-oriented Architecture Workshop (2006)

Past, Present and Future



Topics of research



Grid Services (P2P)



QoS (Quality of Service)



Security in SOA and Web Services



Semantic of Web Services



SOA and BPM



Services Orchestration and Choreography



Web Service Composition and Adaptation



SOA Modeling, Design, Specification

The end

“The problem is that you can’t just buy SOA;

you have to understand it and live it. SOA

is a paradigm. SOA is a way of thinking.

SOA is a value system for architecture and

Referências

Documentos relacionados

As imagens foram vistas várias vezes, possibilitando uma leitura não apenas de seus enquadramentos, planos entre outros aspectos que envolvem determinadas convenções da

Os artigos são encaminhados sem identificação de autoria tanto para os avaliadores ad hoc como para a Editoria Científica a fim de garantir imparcialidade na avaliação. 5.2

(2011) o cycling corresponde às diversas opções apresentadas para o controlo do peso corporal (emagrecimento), pois todas as aulas são planeadas a partir da FC mínima

The effects of three different photophase (L) scotophase ([) combinillions on fecundity (number of host eggs that turned black after parasitization).. egg-adult

Segundo Zuin (2013) a busca pela internalização da disciplina por parte dos alunos, por meio das punições de ordem física ou psicológica, se fundamentou no desejo do professor

Sob tal perspectiva, as teorias da eficiência estática (de Vilfredo Pareto) e dinâmica (de Nicholas Kaldor e John Richard Hicks) serão adotas para a verificação dos ganhos e das

De acordo com o site Selosocial (2018), a certificação de empresas no Programa Municipal Selo Social, consiste em um documento, que reconhece as organizações como

Isla Negra, Michoacán, La Chascona and La Sebastiana are the names that the Chilean Nobel laureate poet, Pablo Neruda, used to refer to his houses. Neruda build his houses, he