opencsa member section – service component architecture 1 1 sca: flexible and agile composition of...

33
OpenCSA Member Section – Service Component Architecture 1 OpenCSA Member Section – Service Component Architecture 1 SCA: Flexible and Agile SCA: Flexible and Agile Composition of Distributed Composition of Distributed SOA Applications SOA Applications www.oasis-open.org Mike Edwards - IBM Hursley Lab, England S S implicity, implicity, C C onsumability, onsumability, A A gility gility

Post on 18-Dec-2015

223 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 1OpenCSA Member Section – Service Component Architecture 1

SCA: Flexible and Agile SCA: Flexible and Agile Composition of Distributed Composition of Distributed

SOA ApplicationsSOA Applications

www.oasis-open.org

Mike Edwards - IBMHursley Lab, England

SSimplicity, implicity, CConsumability, onsumability, AAgilitygility

Page 2: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 2OpenCSA Member Section – Service Component Architecture 2

Agenda

Customer scenario SCA overview SCA details Web 2.0 & SCA

Page 3: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 3OpenCSA Member Section – Service Component Architecture 3

Customer scenario A bank implemented a pilot project using SCA and SDO Growing presence in multiple countries Wide variety of technologies in use:

Unix Mid Range, AS400, Mainframe, WebSphere / WebLogic, Java / .NET, Kitchen Sink

The group that sponsored the project is responsible for Retail Banking Channel – Presentation and Service Tier

Rollout of "Official" SOA strategy Set the standards for future initiatives within the Bank

Page 4: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 4OpenCSA Member Section – Service Component Architecture 4

Problem: Lack of an enterprise-wide SOA framework Proliferation of standards and frameworks

WS-* Apache SOAP Apache AXIS XFire IBM Web Services Runtime Open source frameworks Custom built frameworks

Never ending cycle of migration and reinventing the wheel Hurting time to market Extra costs to maintain

Need to simplify service development Allow service developers to focus on business logic Make it easy to reuse services

Page 5: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 5OpenCSA Member Section – Service Component Architecture 5

Key features of the customer’s infrastructure Service Platform – WS-I Basic compliant, Java-based

client invocation and service endpoint framework Expose services using different interfaces, multiple

invocation mechanisms (local, WSDL/schema, JMS...) Service Lifecycle Events – Logging, Caching, Business

Validation, Error Handling... Enable POJO programming model for developing services Requirements, design, development, operational and other

processes to support SOA approach

Page 6: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 6OpenCSA Member Section – Service Component Architecture 6

Key features of the customer’s infrastructure Enterprise adoption:

Development, Deployment, Operational, Governance Capabilities

Service development training material Collaborative, shared ownership

All process, technical and other documentation placed in a Wiki, open to contributions

Improvements took place using an "open source" model, allowing any resource to contribute to code base, with select group controlling commits

Page 7: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 7OpenCSA Member Section – Service Component Architecture 7

Service Platform

Rich Client UI Mobile IVR

Component

pro

pert

ies

Component

pro

pert

ies

Component

pro

pert

ies

Component

pro

pert

ies

Web User Interface Components

Different Heterogeneous Backend Systems

ThinClient

Browser / AJAX

Page 8: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 8OpenCSA Member Section – Service Component Architecture 8

Layers in the infrastructure Access layer:

Spring Framework (AOP, IOC) for applications, IFX (Interactive Financial Exchange) for schemas and

interfaces SCA/SDO to access services & data sources

Middle tier: WebSphere, Spring, JMS Services built with SCA assembly model IFX data packaged with SDO

Back end: The usual suspects (transaction servers, mainframes,

relational databases, packaged apps)

Page 9: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 9OpenCSA Member Section – Service Component Architecture 9

Infrastructure based on three open standards SCA/SDO:

Becoming widely recognized as a standard

Support for multiple bindings configurable at runtime

Configuration based assembly of components using dependency injection

Components can be implemented using many languages/technologies

Multiple implementations to choose from

Interactive Financial Exchange (IFX)

Standards-based data exchange format for business banking

Spring AOP for lifecycle events

(Logging, Caching, Error Handling, etc.)

Finer grained dependency injection

Page 10: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 10OpenCSA Member Section – Service Component Architecture 10

Selling SCA SCA, SDO enabled business to build service

platform with low barriers to adoption: POJO components Evolutionary SOA adoption Open communities

Some original applications used POJOs. To moving to an SOA, applications changed to use SCA services

For now, the SCA services are just POJOs. When they need to use other kinds of (SCA) services, they don’t have to make any changes

Page 11: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 11OpenCSA Member Section – Service Component Architecture 11

The future Future enhancements to infrastructure will take

advantage of wider features of SCA and SDO: WS-Policy/WS-Security Other implementations (COBOL) Asynchronous invocation (JMS) Presentation layer (AJAX, JSONRPC) BPEL orchestration

Using these features will require very few changes (if any) to their applications

Page 12: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 12OpenCSA Member Section – Service Component Architecture 12

Agenda

Customer scenario SCA overview SCA details Web 2.0 & SCA

Page 13: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 13OpenCSA Member Section – Service Component Architecture 13

What SCA is executableexecutable model for assembling services

composites provide language to compose and configure service components

handles service dependencies

Simplified component programming modelcomponent programming model for implementing services

BPEL processes, Java POJOs, EJBs, COBOL, PHP scripts, C++ apps, JavaScript & AJAX, XSLT…

Late binding of policypolicy and communicationcommunication methods, with distributed deploymentdistributed deployment model

Page 14: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 14OpenCSA Member Section – Service Component Architecture 14

Why SCA makes life simpler One way to look at SCA is that it takes details of

access methods and endpoints implementations and configuration policy such as encryption, authentication

…and moves them into middleware layer Application developers write business logic: code

that actually builds value for your organization details of using services are handled by SCA late binding: as details change, applications (and

developers who wrote them) aren’t affected "no plumbing in the code"

Page 15: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 15OpenCSA Member Section – Service Component Architecture 15

Why SCA makes life simpler SCA gives developers a

single programming model for using servicessingle programming model for using servicesfor all aspects of service lifecycle:

– Construction– Assembly– Deployment

As your SOA gets more complex, developers have to learn more and more interfaces

– In Java alone: EJBs, RMI, JCA, JAX-WS, JMS

Similarly, SDO gives developers a single single programming model for using data sourcesprogramming model for using data sources

Page 16: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 16OpenCSA Member Section – Service Component Architecture 16

SCA is not… …tied to a specific programming language,

protocol, technology, runtime …a workflow model

Use BPEL for that …Web services

SCA can access local objects, avoiding the overhead of Web services

of course, many SCA applications will use Web services

…an ESB to program an ESB from scratch, SCA fits perfectly but SCA is more than an ESB

Page 17: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 17OpenCSA Member Section – Service Component Architecture 17

Warehouse Service

WarehouseComposite

WarehouseBroker

Component

WarehouseComponent

Order Processing

Service

OrderProcessingComponent

Shipping Reference

External Warehouse

Reference

PaymentsComponentPayment

Service

AccountsComposite

ExternalBanking

Reference

AccountsLedger

Component

SCA assembly

BPEL

Java EE

C++

SOAP/HTTP

JMS

RMI/IIOP

Mixed:- technologies- app locations

Multi-levelcomposition

Page 18: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 18OpenCSA Member Section – Service Component Architecture 18

Agenda

Customer scenario SCA overview SCA details Web 2.0 & SCA

Page 19: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 19OpenCSA Member Section – Service Component Architecture 19

ServiceAccountService

ReferenceStockQuoteService

AccountDataServiceComponent

bigbank.accountcomposite

AccountServiceComponent

ServiceAccountService

AccountDataServiceComponent

Simple Example

Page 20: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 20OpenCSA Member Section – Service Component Architecture 20

<reference name=“StockQuoteService" promote="AccountServiceComponent/StockQuoteService"> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.ws port="http://example.org/StockQuoteService# wsdl.endpoint(StockQuoteService/StockQuoteServiceSOAP)"/> </reference>

<service name="AccountService" promote="AccountServiceComponent"> <interface.java interface="services.account.AccountService"/> <binding.ws port="http://www.example.org/AccountService# wsdl.endpoint(AccountService/AccountServiceSOAP)"/> </service>

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="bigbank.accountcomposite" >

<composite>

<component name="AccountServiceComponent"> <implementation.java class="services.account.AccountServiceImpl"/> <reference name="StockQuoteService"/> <reference name="AccountDataService" target="AccountDataServiceComponent/AccountDataService"/> <property name="currency">EURO</property> </component>

<component name="AccountDataServiceComponent"> <implementation.bpel process=“QName"/> <service name="AccountDataService"> <interface.java interface="services.accountdata.AccountDataService"/> </service> </component>

StockQuotebigbank.accountcomposite

AccountServiceComponent

ServiceAccountService

ReferenceStockQuoteService

AccountDataServiceComponent

ReferenceStockQuoteService

Page 21: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 21OpenCSA Member Section – Service Component Architecture 21

Java Implementation Example: Service Interface

package org.example.services.account;

@Remotablepublic interface AccountService {

public AccountReport getAccountReport(String customerID);}

Interface is callable remotelyeg. as a Web service

Page 22: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 22OpenCSA Member Section – Service Component Architecture 22

Java Implementation Example (1)

package org.example.services.account;

import org.osoa.sca.annotations.*;

@Service(interfaces = AccountService.class)public class AccountServiceImpl implements AccountService {

private String currency = "USD"; private AccountDataService accountDataService; private StockQuoteService stockQuoteService;

public AccountServiceImpl( @Property("currency") String currency, @Reference("accountDataService") AccountDataService dataService, @Reference("stockQuoteService") StockQuoteService stockService) { this.currency = currency; this.accountDataService = dataService; this.stockQuoteService = stockService; }

Annotation for the service offered by this class

Constructor with annotations for injected property and references

Page 23: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 23OpenCSA Member Section – Service Component Architecture 23

Java Implementation Example (2)

public AccountReport getAccountReport(int customerID) throws AccountDataUnavailableException {

AccountReport accountReport = accountDataService.getAccountReport(customerID); List<Stock> stocks = accountReport.getStocks();

List<StockValues> stockValues = stockQuoteService.getValues( stocks, currency );

accountReport.setStockValues( stockValues );

return accountReport;}

} // end class

Get the basic account report using the account data service

Obtain up to date stock values using the stock quote service

Update the account report with the latest stock values

Page 24: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 24OpenCSA Member Section – Service Component Architecture 24

Confidentiality applied to any use of the service

Associating Policies with SCA Components

Intents and/or policySets can be associated with any SCA component

At deployment time intents map to Policies contained in policySets Examples attaching intents:

<service name="AccountService“ promote=“AccountServiceComponent” requires="sca:confidentiality"> <interface.java interface="services.account.AccountService"/> <binding.ws port="http://www.bigbank.com/AccountService# wsdl.endpoint(AccountService/AccountServiceSOAP)"/></service><reference name="StockQuoteService“ promote=“AccountServiceComponent/ stockQuoteService”> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.ws port="http://www.quickstockquote.com/StockQuoteService# wsdl.endpoint(StockQuoteService/StockQuoteServiceSOAP)“# requires=“sca:confidentiality”/></reference> Confidentiality applied to

Web service binding

Page 25: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 25OpenCSA Member Section – Service Component Architecture 25

Policy Sets Policy Sets contain concrete Policies

<policySet name="sca:userNameTokenHashPassword" provides="sca:authentication" appliesTo="sca:binding.ws">

<wsp:Policy> <sp:SupportingToken> <wsp:Policy> <sp:UserNameToken> <wsp:Policy> <sp:HashPassword> </wsp:Policy> </sp:UserNameToken> </wsp:Policy> </sp:SupportingToken> </wsp:Policy></policySet>

defines intents provided

what this policy applies to

Page 26: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 26OpenCSA Member Section – Service Component Architecture 26

SCA Runtime

SCA PHP Container

Assigned to be hosted by SCA Java container Assigned to be

hosted by SCA CPP container

Runtime Topology

DeploymentMapping

Service Compositions

SCA Domain

bigbank.accountmanagement

bigbank.stockquote

SCA JEE Containers SCA CPP Containers…

SCA Java Containers

SCA BPEL Container

Page 27: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 27OpenCSA Member Section – Service Component Architecture 27

Agenda

Customer scenario SCA overview SCA details Web 2.0 & SCA

Page 28: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 28OpenCSA Member Section – Service Component Architecture 28

Web 2.0 Composite Applications

Web Server

HTML + JS

Services

“implementation.widget”- HTML + Javascript with SCA reference wiring- Access services from scripts – with async

“implementation.widget”

Page 29: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 29OpenCSA Member Section – Service Component Architecture 29

Web 2.0 Gadgets meet SCAWeb Server

Gadget + HTML + JS

Services

“implementation.widget”

“implementation.widget”- HTML + Gadgets with SCA reference wiring- Access services from scripts – with async- Link to other on-screen gadgets

other Widgets

can be anygadget supportingmashup technology

Page 30: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 30OpenCSA Member Section – Service Component Architecture 30

HTML & JS SCA Implementation

Store Implementation<html><head><title>Store</title>

<script type="text/javascript" src="store.js"></script><script language="JavaScript">

//@Referencevar catalog = new Reference("catalog");

//@Referencevar shoppingCart = new Reference("shoppingCart");

//@Referencevar shoppingTotal = new Reference("shoppingTotal");

function catalog_getResponse(items) {…}function shoppingCart_getResponse(feed) {…}

function init() {catalog.get(catalog_getResponse);shoppingCart.get("", shoppingCart_getResponse);

}

</script>

</head>

<body onload="init()"><h1>Store</h1>

…</body></html>

Defines references to services

Call reference operations

Page 31: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 31OpenCSA Member Section – Service Component Architecture 31

HTML & JS Component Configuration

Store Configuration<composite name="store" … >

<component name="Store"><t:implementation.widget location="uiservices/store.html"/><service name="Widget">

<t:binding.http uri="/ui"/></service><reference name="catalog" target="Catalog">

<t:binding.jsonrpc/> </reference> <reference name="shoppingCart" target="ShoppingCart/Cart"> <t:binding.atom/> </reference> <reference name="shoppingTotal" target="ShoppingCart/Total"> <t:binding.jsonrpc/> </reference>

</component>

<component name="ShoppingCart"><implementation.java class="services.ShoppingCartImpl"/><service name="Cart">

<t:binding.atom uri="/ShoppingCart/Cart"/></service> <service name="Total">

<t:binding.jsonrpc/></service>

</component>…

</composite>

HTML & JS implementation

HTTP binding & address

Catalog service via JSONRPC

Wire

Page 32: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 32OpenCSA Member Section – Service Component Architecture 32

Summary

OASIS SCA is a great way to build distributed services applications Compose services Develop service components Apply policies and bindings

Agile and Flexible systems

Page 33: OpenCSA Member Section – Service Component Architecture 1 1 SCA: Flexible and Agile Composition of Distributed SOA Applications  Mike

OpenCSA Member Section – Service Component Architecture 33OpenCSA Member Section – Service Component Architecture 33

Useful links Articles about SCA: http://www.infoq.com/articles/setting-out-for-sca http://www.osoa.org/display/Main/SCA+Resources

Open Source implementation of SCA: http://cwiki.apache.org/TUSCANY/

SCA Specifications in OASIS: http://www.oasis-opencsa.org/

Email address: [email protected]