principles of service orientation

63
PRINCIPLES OF SERVICE ORIENTATION PROGRAMAÇÃO DE SISTEMAS DISTRIBUIDOS Paulo Gandra de Sousa [email protected]

Upload: paulo-sousa

Post on 03-Jul-2015

269 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Principles of Service Orientation

PRINCIPLES

OF SERVICE

ORIENTATIONPROGRAMAÇÃO DE SISTEMAS

DISTRIBUIDOS

Paulo Gandra de Sousa

[email protected]

Page 2: Principles of Service Orientation

Principles of service design2

ISEP/IPP

Thomas Erl

ISBN: 0132344823

http://www.soaprinciples.com/

http://www.soapatterns.org/

Page 3: Principles of Service Orientation

Service Orientation3

Page 4: Principles of Service Orientation

Service6

ISEP/IPP

Services are :

Modules of business.

Functionality of application.

The service is successful implemented, when :

reused.

Takes part of compositions

Page 5: Principles of Service Orientation

Types of Service8

Entity Services

Utility Services

Task Services

Orchestrated Task Services

Page 6: Principles of Service Orientation

Entity Services9

ISEP/IPP

Responsible for processing business logic.

Always take part in automation of business

processes.

May need to compose other services to carry

out its capabilities.

Conventions need to extend to data

representation of business and context

information delivered by messages to ensure

steady interoperability.

Page 7: Principles of Service Orientation

Utility Services10

ISEP/IPP

Cross-cutting functionality

Typicaly not business logic related

Sometimes intentionally designed to violate

Service principles

Page 8: Principles of Service Orientation

Task Services11

ISEP/IPP

Task-centric services have a functional scope

centered around a business process.

Positioned as composition controllers, and for

significantly sized compositions.

Can be needed to defer context data in order

to alternate between stateful and stateless

conditions.

Page 9: Principles of Service Orientation

Orchestrated Task Services12

ISEP/IPP

Manage an activity during its entire lifespan.

Fully expected to remain stateful.

If the duration of process inactivity exceeds a

certain timeout period, state data is stored in a

database until it is needed to be revived.

Page 10: Principles of Service Orientation

Granularity13

Page 11: Principles of Service Orientation

Service Granularity14

ISEP/IPP

the overall quantity of functionality

encapsulated by a service.

Page 12: Principles of Service Orientation

Capability Granularity15

ISEP/IPP

The quantity of functionality encapsulated by a

specific service capability

Page 13: Principles of Service Orientation

Data Granularity16

ISEP/IPP

the quantity of data exchanged by a specific

service capability

Page 14: Principles of Service Orientation

Constraint Granularity17

ISEP/IPP

Page 15: Principles of Service Orientation

The 4 tenets of SOA18

Page 16: Principles of Service Orientation

The four tennets of SOA19

ISEP/IPP

Boundaries are explicit

Share schema and contract not types

Policy define service compatibility

Services are autonomous

Page 17: Principles of Service Orientation

Boundaries are explicit20

ISEP/IPP

Service boundaries are explicit and the cost of

crossing a boundary is “known”

A boundary is the border between the service

public interface and its internal implementation

Services interact intentionaly and explicitly by

exchanging messages

Page 18: Principles of Service Orientation

Share schema and contract not

types21

ISEP/IPP

Services expose schemas defining data

structures and contracts defining available

operations

Contracts and schema may be independently

versioned over time

Page 19: Principles of Service Orientation

Policy define service

compatibility22

ISEP/IPP

Policy is the statement of communication

requirements necessary for service interaction

Service capabilities and requirements are

expressed in terms of a policy expression

A policy can contain multiple assertions

Page 20: Principles of Service Orientation

Services are autonomous23

ISEP/IPP

Services are independently deployed,

versioned and managed

Topology of a system evolves over time

Unlike OO, services do not share behavior

Services gracefully handle failure

Page 21: Principles of Service Orientation

Principles of Service Orientation24

Standardized Contracts

Abstraction

Reusability

Autonomy

Autonomy

Coupling

Statelessness

Page 22: Principles of Service Orientation

Standardized Contracts25

Page 23: Principles of Service Orientation

Standardized Contracts26

ISEP/IPP

Services within the same service inventory are

in compliance with the same contract design

standards

Contract-first design

Transfromation avoidance

Page 24: Principles of Service Orientation

Contract-First Design27

ISEP/IPP

Page 25: Principles of Service Orientation

Avoid Transformation

A fundamental goal

of this design

principle is

transformation

avoidance through

the standardization

of data

representation

across service

contracts.

28ISEP/IPP

Page 26: Principles of Service Orientation

Service Loose Coupling29

Page 27: Principles of Service Orientation

Loose Coupling30

ISEP/IPP

Service contracts impose low consumer

coupling requirements and are themselves

decoupled from their surrounding environment

Page 28: Principles of Service Orientation

Service contract coupling31

ISEP/IPP

Page 29: Principles of Service Orientation

Service contract coupling

Logic-to-Contract

Coupling

Contract-to-Logic

Coupling

Contract-to-Technology

Coupling

Contract-to-

Implementation Coupling

Contract-to-Functional

Coupling

32ISEP/IPP

Page 30: Principles of Service Orientation

Consumer coupling33

ISEP/IPP

Consumer-to-Contract Coupling

Consumer-to-Implementation Coupling

Page 31: Principles of Service Orientation

Consumer coupling

Ultimately, undesirable

forms of coupling can

proliferated to the

consumer.

34ISEP/IPP

Page 32: Principles of Service Orientation

Service Abstraction35

Page 33: Principles of Service Orientation

Service Abstraction36

ISEP/IPP

Service contracts only contain essential

information and information about services is

limited to what is published in service

contracts

Page 34: Principles of Service Orientation

Hiding details

Hide as much as

possible

“hidden

composition” issue

service consumer

are unaware that the

service they are

invoking

encapsulates an

entire composition.

37ISEP/IPP

Page 35: Principles of Service Orientation

Service Reusability38

Page 36: Principles of Service Orientation

Service Reusability39

ISEP/IPP

Services contain and express agnostic logic

and can be positioned as reusable enterprise

resources.

Page 37: Principles of Service Orientation

Service Autonomy40

Page 38: Principles of Service Orientation

Service Autonomy41

Services exercise a high level of control over their underlying runtime execution environment

Services are independent to dominate there own code executions.

Take decisions independently of the external influences or involvement.

The objective is to:

increase reliability and behavioural predictability

increase reuse and composition of the service

Page 39: Principles of Service Orientation

Runtime Autonomy42

ISEP/IPP

the degree of control that a service has over is

own processes invocations and executions.

It affects:

Service execution performance;

Service degree of isolation, reliability and

security;

The prediction of how a service will act;

Page 40: Principles of Service Orientation

Design-Time Autonomy43

ISEP/IPP

the degree of freedom that a service owner

has to change the design or architecture, of his

service, over the time.

It helps on:

The scalability of the service;

The update of the “service´s hosting

environment”;

The update or replace the technology used by the

service;

The performance of the Runtime Autonomy;

Page 41: Principles of Service Orientation

Service Contract Autonomy

represents independency of the service contract from the code.

The code behaviorcan change but it´s signature on the contract can not.

To help create this, the service contract and code need to be normalized.

45ISEP/IPP

Page 42: Principles of Service Orientation

Shared Autonomy

the way in which the

other components

access and compete

for resources of a

service with low or

non-existing

autonomy.

46ISEP/IPP

Page 43: Principles of Service Orientation

Service Logic Autonomy

A.k.a. partially isolated services

Represents how isolated and independents services that use the same resources (databases, directories, etc) work with each other.

Issues associated: Difficult to implement

scalability;

Increases slow Runtime and unpredictable behavior

47ISEP/IPP

Page 44: Principles of Service Orientation

Pure Autonomy (full isolation)48

ISEP/IPP

represents the full isolation of the entire service that has the control of is own “internal” Runtime.

It has 3 types of isolation:

Functional Isolation – The services are separated, but are hosted in the same server with the same Runtime;

Absolute Isolation – The services are separated physically. Each has its server and Runtime;

Isolated Services at Design-Time – Pure Autonomy gives complete control on the service design, hosting environments and scalability.

Page 45: Principles of Service Orientation

Pure Autonomy

Functional isolation Absolute Isolation

49ISEP/IPP

Page 46: Principles of Service Orientation

Service Statelessness50

Page 47: Principles of Service Orientation

Statelessness51

Services minimize resource consumption by

deferring the management of state information

when necessary

Page 48: Principles of Service Orientation

Non-Deferred State

Management 52

ISEP/IPP

Low-to-no statelessness.

Remain active and stateful for continuous

periods.

Does not require an external state deferral

extension

Page 49: Principles of Service Orientation

Partially Deferred Memory53

ISEP/IPP

Reduced statefulness.

Generic model of a Web Server.

The service continues active while retaining

some state data.

Page 50: Principles of Service Orientation

Partial Deferral State

Management54

ISEP/IPP

Moderate statelessness.

Takes advantage of stateless at certain times.

Not designed to take advantage of every

possible opportunity to become stateless.

Page 51: Principles of Service Orientation

Internally Deferred State

Management55

ISEP/IPP

High statelessness

Maximizes its opportunities to exist in a

stateless condition.

Even when stateful, it defers state data when

possible.

Page 52: Principles of Service Orientation

Service Discoverability56

Page 53: Principles of Service Orientation

Service Discoverability

Services are

supplemented with

communicative meta

data by which they

can be effectively

discovered and

interpreted

57ISEP/IPP

Page 54: Principles of Service Orientation

Service Composibility58

Page 55: Principles of Service Orientation

Service Composibility59

ISEP/IPP

Services are effective composition

participants, regardless of the size and

complexity of the composition.

the ability to create and provision complex

value added services from other services

resulting in composite services.

Page 56: Principles of Service Orientation

60ISEP/I

PP

Page 57: Principles of Service Orientation

Service Composition61

ISEP/IPP

Page 58: Principles of Service Orientation

Creating a composable

inventory62

ISEP/IPP

Page 59: Principles of Service Orientation

Closings63

Page 60: Principles of Service Orientation

Service Principles Poster64

ISEP/IPP

http://serviceorientation.com/static/pdf/SOA_Principles_Poster.pdf

Page 61: Principles of Service Orientation

Principles of service design65

ISEP/IPP

Thomas Erl

ISBN: 0132344823

http://www.soaprinciples.com/

http://www.soapatterns.org/

Page 62: Principles of Service Orientation

References66

SOA Principles of Service Design, Thomas Erl.

Principles of Service design: service patterns

and anti-patterns. John Evdemon (2005)

http://msdn.microsoft.com/en-

us/library/ms954638.aspx

Page 63: Principles of Service Orientation

PROGRAMAÇÃO DE

SISTEMAS

DISTRIBUIDOSPaulo Gandra de Sousa

[email protected]