You are on page 1of 21

Service Layers

605.702 Service Oriented Architecture Johns-Hopkins University Montgomery County Center, Spring 2009 Session 6, Lecture 6: March 4, 2009 Instructor: T. Pole

Required Reading for This Week
Chapter 9: Service Layers

Todays Presentation
Update on Chapter 8

Todays Lecture
Text CH 9

Class Assignments
Exercise #4, Implementing a Service Composition

Review for Mid Term Exam

Mid Term is next week Wednesday March 11, 2009

Ch 8 Principles of Service Orientation

Additional notes on Chapter 8 have been added to the lecture notes for last week, Lecture 5 2/25/09 Check these notes in reviewing for the mid term exam next week

Chapter 9: Service Layers

9.1 SO and Contemporary SOA
Review table 9.1: how SOA characteristics are influenced by Web Service specs and SO principles

9.2 Service Layer Abstraction

The service layer is between the application layer and the business process layer (see Ch 8) The implementation of the service interface layer is sub-divided into layers following one of several different models

9.3 Application Service Layer 9.4 Business Service Layer 9.5 Orchestration Service Layer 9.6 Agnostic Services 9.7 Service Layer Scenarios

9.2 Service Layer Abstraction

Figure 9.2 shows the SOA layers WITHIN the single Service Interface Layer of the Enterprise Architecture
Business Process Layer
Processes of the Enterprise, not just the IT systems

Service Interface Layer

Orchestration Layer Business Service Layer
NOT the Business Process Layer

Application Service Layer

NOT the Application Layer

Application Layer
Legacy and Service Implementations

9.3 Application Service Layer

Sits within the Service Interface Layer, and integrates with the Application Layer below Solution (Meaning business process) agnostic, are more generic and usually reusable across multiple biz processes Can also be used to integrate other application services Mixture of custom and COTS products Hybrids may cross the line between business and application logic

9.4 Business Service Layer

Business services can be mapped to small grained or low level specific business processes and entities Business oriented services can be
Entity Centric Task Centric Not both, but a business service layer can be a mix of both. Usually will be primarily one or the other

9.5 Control or Orchestration Service Layer

Introduces another type or service, the process service (aka but not synonymous with the controller service) Directly relates to a business process Controls other business, hybrid and application/utility services to automate a process Can be implemented in non-technical languages, e.g. BPEL

9.6 Agnostic Services

Agnostic in this context can mean not bound to any one process
e.g. an entity based service can be used by multiple biz processes that involve that entity e.g. a utility service is by definition a generic reusable service not bound to any business entity: task or entity based

Exist with the application service layer or the business layer

9.7 Service Layer Scenarios

There is no one layered model for the Service Interface Layer, some options are:
Single hybrid layer
Common, doesnt evolve well, brittle

Hybrid over utility

Also common among mature software developers, reuse driven

Biz task centric over utility

Often the goal for mature business centric developers

Task centric over entity centric over utility

Common among mature systems, flexible, adaptable

Orchestration over hybrid over utility

Better then single hybrid, but extending to new orch. difficult

Orchestration over task centric over utility

Flexible, evolves well, flexibly adjusts to change

Exercise #4: Implementing a TestConsumerUI Service Composition

SEAM Index -----------------Register Asset FindAsset ClassifyAsset

TextIndexer -----------------IndexDoc QueryIndex DocManager -----------------StoreDoc GetDoc ClassifyAsset

Exercise #4 Interface: Services and Operations

SEAMIndex Service (New Service and Functions)
AssetID RegisterAsset( string AssetAsText ) AssetID FindAsset( string Title, string Author ) bool ClassifyAsset( string AssetID, string Class)

TextIndexer Service (Wraps Legacy Component)

Bool StatusFlag IndexDoc( string DocAsText ) AssetID[] QueryIndex( string Title, string Author )

DocManager Service (Wraps Legacy Component)

AssetID StoreDoc( string DocContent ) string GetDoc( string DocID ) bool ClassifyDoc( string DocID, string Classification )

Legacy Components API

Supplied as C# Functions
bool IndexTerms( string Content ) String FindDocs( string Title, string Author )

string Store( string DocContent ) string Retrieve( string DocID ) bool Categorize( string DocID, string Category )

Integrating Legacy Apps

Download complete applications assemblies from class web site
Integration Stubs available now Fully functional projects will be published next week

Add as projects to your solution

Review for Mid Term Exam

Review of the previous lectures Q&A for Chapters 1 9 Review of Implementing Web Services and SOA Designs in Visual Studio/ASP.Net Additional Notes

SOA Implementation via Web Services in ASP.Net

Exercise #1: Web Service Consumers
Web Reference
What is it doing? What is its purpose?

Exercise #2: Building a Web Service

What does a Visual Studio Web Service project generate?

Exercise #3: Publishing a Web Service

What is published to the remote site?

Additional Notes: Service Orientedness

When designing a service oriented architecture, ask yourself:
Is communication among services and consumers like a phone conversation or the exchange of standard forms If it is like a phone call interview, it is chatty and not service oriented.
A service is being performed, but each interaction in the system is only a piece of the complete service

If it is like an exchange of standard forms, and all the information required to perform the service is on that single initial form, and the information required is returned in a equally complete single form, it is service oriented

Example: You need to determine if several checks youve written have cleared the bank.

Not Service Oriented

Call the bank, the operator ask what your need is. You respond you wish to verify if these checks have cleared They ask you to identify your account and your person. They validate your identity and ask which checks: which numbers and what dates. You give them the check information, one check at a time. They verify each one at a time.

Service Oriented
You fill out a form which includes your account information, personal identifiers, the service you want performed (verify checks have cleared), and the numbers of the checks. The response is another form listing the state of all the checks you have asked to have verified.

The Difference?
They both perform the same business process They both have the same accuracy and completeness One is a complete service performed in one single step, and is service oriented The other is performed by many related interdependent steps, and is not

Session 7: 3/11/09
Mid Term Exam Introduction of Class Week

Spring Break the following week

Exercise #4 is due 3/25/09 Specifications for Class Project will be presented