Title: SCA: Flexible and Agile Composition of Distributed SOA Applications
1SCA Flexible and Agile Composition of
Distributed SOA Applications
www.oasis-open.org
Mike Edwards - IBM Hursley Lab, England
Simplicity, Consumability, Agility
2Agenda
- Customer scenario
- SCA overview
- SCA details
- Web 2.0 SCA
3Customer 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
4Problem 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
5Key features of the customers 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
6Key features of the customers 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
7 Thin Client Browser / AJAX
Rich Client UI
IVR
Mobile
Web User Interface Components
Service Platform
Different Heterogeneous Backend Systems
8Layers 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)
9Infrastructure 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
10Selling 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 dont have to make any changes
11The 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
12Agenda
- Customer scenario
- SCA overview
- SCA details
- Web 2.0 SCA
13What SCA is
- executable model for assembling services
- composites provide language to compose and
configure service components - handles service dependencies
- Simplified component programming model for
implementing services - BPEL processes, Java POJOs, EJBs, COBOL, PHP
scripts, C apps, JavaScript AJAX, XSLT - Late binding of policy and communication methods,
with distributed deployment model
14Why 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) arent affected - "no plumbing in the code"
15Why SCA makes life simpler
- SCA gives developers a single 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
programming model for using data sources
16SCA 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
17SCA assembly
RMI/IIOP
AccountsComposite
External Banking Reference
Payments Component
Payment Service
OrderProcessing Component
Order Processing Service
Java EE
Accounts Ledger Component
BPEL
SOAP/HTTP
Multi-level composition
WarehouseComposite
External Warehouse Reference
Warehouse Broker Component
Mixed - technologies - app locations
Warehouse Component
Warehouse Service
JMS
Shipping Reference
C
18Agenda
- Customer scenario
- SCA overview
- SCA details
- Web 2.0 SCA
19Simple Example
bigbank.accountcomposite
Reference
StockQuote
Service
AccountService
Service
Service
Component
AccountService
AccountService
AccountData
AccountData
Service
Service
Component
Component
20ltcomposite xmlns"http//www.osoa.org/xmlns/sca/1.
0" name"bigbank.accountcomposite"
gt ltcompositegt
ltservice name"AccountService"
promote"AccountServiceComponent"gt
ltinterface.java interface"services.account.Accoun
tService"/gt ltbinding.ws
port"http//www.example.org/AccountService
wsdl.endpoint(AccountService/AccountServiceSO
AP)"/gt lt/servicegt
ltcomponent name"AccountServiceComponent"gt
ltimplementation.java class"services.account.
AccountServiceImpl"/gt ltreference
name"StockQuoteService"/gt ltreference
name"AccountDataService"
target"AccountDataServiceComponent/AccountDataSer
vice"/gt ltproperty name"currency"gtEUROlt/pr
opertygt lt/componentgt
bigbank.accountcomposite
StockQuote
Reference
Reference
StockQuote
StockQuote
Service
Service
ltcomponent name"AccountDataServiceComponent"gt
ltimplementation.bpel processQName"/gt
ltservice name"AccountDataService"gt
ltinterface.java interface"services.accountdat
a.AccountDataService"/gt lt/servicegt
lt/componentgt
AccountService
Service
Component
AccountService
AccountData
Service
Component
ltreference nameStockQuoteService"
promote"AccountServiceComponent/StockQuoteService
"gt ltinterface.java interface"services.sto
ckquote.StockQuoteService"/gt ltbinding.ws
port"http//example.org/StockQuoteService
wsdl.endpoint(StockQuoteService/StockQuoteServ
iceSOAP)"/gt lt/referencegt
21Java Implementation Example Service Interface
Interface is callable remotely eg. as a Web
service
package org.example.services.account _at_Remotable
public interface AccountService public
AccountReport getAccountReport(String
customerID)
22Java Implementation Example (1)
package org.example.services.account import
org.osoa.sca.annotations. _at_Service(interfaces
AccountService.class) public class
AccountServiceImpl implements AccountService
private String currency "USD" private
AccountDataService accountDataService
private StockQuoteService stockQuoteService
public AccountServiceImpl(
_at_Property("currency") String currency,
_at_Reference("accountDataService")
AccountDataService dataService,
_at_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
23Java Implementation Example (2)
public AccountReport
getAccountReport(int customerID)
throws AccountDataUnavailableException
AccountReport accountReport
accountDataService.getAccountReport(customerID)
ListltStockgt stocks
accountReport.getStocks()
ListltStockValuesgt 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
24Associating 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
Confidentiality applied to any use of the service
ltservice name"AccountService promoteAccountSer
viceComponent requires"scaconfidentiality"gt
ltinterface.java interface"services.account.Acc
ountService"/gt ltbinding.ws port"http//www.big
bank.com/AccountService wsdl.endpoint(Accou
ntService/AccountServiceSOAP)"/gt lt/servicegt ltrefer
ence name"StockQuoteService
promoteAccountServiceComponent/
stockQuoteServicegt ltinterface.java
interface"services.stockquote.StockQuoteService"/
gt ltbinding.ws port"http//www.quickstockquote.
com/StockQuoteService wsdl.endpoint(StockQu
oteService/StockQuoteServiceSOAP)
requiresscaconfidentiality/gt lt/referencegt
Confidentiality applied to Web service binding
25Policy Sets
- Policy Sets contain concrete Policies
ltpolicySet name"scauserNameTokenHashPassword"
provides"scaauthentication"
appliesTo"scabinding.ws"gt ltwspPolicygt
ltspSupportingTokengt ltwspPolicygt
ltspUserNameTokengt ltwspPolicygt
ltspHashPasswordgt lt/wspPolicygt
lt/spUserNameTokengt lt/wspPolicygt
lt/spSupportingTokengt lt/wspPolicygt lt/policySetgt
defines intents provided
what this policy applies to
26(No Transcript)
27Agenda
- Customer scenario
- SCA overview
- SCA details
- Web 2.0 SCA
28Web 2.0 Composite Applications
Web Server
implementation.widget
HTML JS
Services
implementation.widget- HTML Javascript with
SCA reference wiring- Access services from
scripts with async
29Web 2.0 Gadgets meet SCA
Web Server
implementation.widget
Gadget HTML JS
Services
implementation.widget- HTML Gadgets with SCA
reference wiring- Access services from scripts
with async - Link to other on-screen gadgets
other Widgets
can be any gadget supporting mashup technology
30HTML JS SCA Implementation
- Store Implementation
- lthtmlgt
- ltheadgt
- lttitlegtStorelt/titlegt
- ltscript type"text/javascript" src"store.js"gtlt/sc
riptgt - ltscript language"JavaScript"gt
- //_at_Reference
- var catalog new Reference("catalog")
- //_at_Reference
- var shoppingCart new Reference("shoppingCart")
- //_at_Reference
- var shoppingTotal new Reference("shoppingTotal"
) - function catalog_getResponse(items)
Defines references to services
Call reference operations
31HTML JS Component Configuration
- Store Configuration
- ltcomposite name"store" gt
- ltcomponent name"Store"gt
- lttimplementation.widget location"uiservices/st
ore.html"/gt - ltservice name"Widget"gt
- lttbinding.http uri"/ui"/gt
- lt/servicegt
- ltreference name"catalog" target"Catalog"gt
- lttbinding.jsonrpc/gt
- lt/referencegt
- ltreference name"shoppingCart"
target"ShoppingCart/Cart"gt - lttbinding.atom/gt
- lt/referencegt
- ltreference name"shoppingTotal"
target"ShoppingCart/Total"gt - lttbinding.jsonrpc/gt
- lt/referencegt
- lt/componentgt
-
HTML JS implementation
HTTP binding address
Catalog service via JSONRPC
Wire
32Summary
- OASIS SCA is a great way to build distributed
services applications - Compose services
- Develop service components
- Apply policies and bindings
- Agile and Flexible systems
33Useful links
- Articles about SCA
- http//www.infoq.com/articles/setting-out-for-sca
- http//www.osoa.org/display/Main/SCAResources
- Open Source implementation of SCA
- http//cwiki.apache.org/TUSCANY/
- SCA Specifications in OASIS
- http//www.oasis-opencsa.org/
- Email address
- mike_edwards_at_uk.ibm.com