Tuscany-SOAWorld - Apache Software Foundation
Download
Report
Transcript Tuscany-SOAWorld - Apache Software Foundation
IBM Software Group
Practical SOA With Apache Tuscany
SOAWorld 2007 West
Raymond Feng
[email protected]
11/12/2007
IBM Software Group
Agenda
Apache Tuscany
Service Component Architecture (SCA)
Scenario walk-through with Tuscany SCA
2
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
What’s Apache Tuscany
Apache Tuscany is an open source project under
Apache incubation.
It provides infrastructure which simplifies development,
assembly and deployment and management of composite
applications in SOA.
Apache Tuscany implements SCA and SDO
standards defined by the OASIS OpenCSA and also
provides extensions based on real user feedback.
Apache Tuscany provides implementation for SCA,
SDO and DAS in Java and C++. Focus of this talk is
Tuscany SCA Java.
3
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
The SCA Specifications
SCA is going through a formal standardization process in the OASIS OpenCSA
(http://www.oasis-opencsa.org) and is backed by many industry leaders
Assembly
Policy Framework
Bindings
Security
Java
JEE
Web services
RM
Spring
BPEL
JMS
Transactions
4
Implementation
Languages
C++
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
JCA
IBM Software Group
The SOA as a blueprint & the reality
Blueprint: Service Oriented Architecture (SOA) is a
business-centric IT architectural approach that suggests
the following.
Business functions are reusable
Business functions are composable
Business functions are flexible to change
Reality: SCA defines a model or path to SOA. An open
source implementation such as Apache Tuscany brings
the power of SCA to application developers openly to
make SOA practical.
5
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
The challenges
Application Developers are faced with these challenges:
Early design decisions are incorporated into business
applications to accommodate for IT infrastructure needs.
Forced to learn and understand many technologies beyond the
business domain knowledge
Business logic is polluted with IT infrastructure. It's not easy to
write and not easy to change.
SCA separates business concerns from all of the above
Application Code
6
EJB APIs
JMS APIs
JAX-WS APIs
JCA APIs
RMI/IIOP
JMS
Web Services
JCA
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
High-level view of SCA
Imagine some distributed application made up of a number of components
Each component has some
business function
Components provide
services
Components consume
other services
Components are wired
Together (composite application)
Components are deployed
to physical runtimes
SCA separates construction, assembly and
Deployment, is extendible and supports: Multiple
languages, multiple access methods and
implementation technologies
7
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Developing SOA with SCA
Model the structure of the application
Identify what business functions are required and describe them using SCA
components and services
Identify what dependencies each component has and provide each component
with suitable SCA references.
Introduce SCA properties for any values that will have to change as the
application is reconfigured or redeployed.
Compose the services within an SCA composite structure and connect references
to services using wires
Provide business logic
Implement each component and reference the implementation from the
component. The implementation may simply wrap existing application logic or
maybe completely new.
Provide deployment specific information
Describe any specific protocols that need to be used using bindings. References
and services without bindings will automatically adopt a default communication
strategy
Attach organizational policy intents to the model, for example, security intents
such as authorization or confidentiality
8
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Mortgage Application Example
Mortgage Composite
Credit Check
Business
model
Interest Rate Quote
Credit
Check
SCA
model
Interest
Rate
Loan Approval
Mortgage Calculator
Loan
Approval
(Java)
Mortgage
Calculator
Risk
Assessment
Risk Assessment
Business Questions
Mortgage Application
SCA terminology
What business functions are required
to provide a solution?
Define services or use existing services: loan
approval, credit check,etc
Components
What function is provided by the
business logic?
LoanApproval approves/rejects a loan application
Services
What dependencies are there
between these business functions?
Loan approval depends on credit check
References
What’s the contract for the business
function provided or consumed?
CreditCheck takes a social security number and
returns the credit score
Interface
How is flexibility in business
processes handled?
Ability to configure minimum credit score
properties
How does the business functions
communicate?
How does the loan approval talk to credit check?
How do the business functions work
together?
The mortgage calculator calculates the monthly
payment for loan approval.
How are regulations or quality of
The credit check needs to be authenticated and
service issues handled?
authorized
9
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Binding
Composite/Wire
Intent/policy
IBM Software Group
LoanApproval Component
service
interface
- Java
- WSDL
binding
- Web Services
- JMS
- EJB SLSB (RMI-IIOP)
- SCA
- etc.
- Easily extended to
include others
property
@Service(LoanApproval.class)
public class LoanApprovalImpl implements LoanApproval {
…
@Reference
public RiskAssessment riskAssessment;
@Property(name = "minimumCreditScore")
public void setMinimumCreditScore(int
minimumCreditScore) {
this.minimumCreditScore = minimumCreditScore;
}
@Reference
public void setCreditCheck(CreditCheck[] creditCheck) {
this.creditCheck = creditCheck;
}
public boolean approve(Customer customer, double
loanAmount, int years) {
…
double monthlyPayment =
mortgageCalculator.getMonthlyPayment(loanAmount, years,
rate);
…
}
binding
- Web Services
- JMS
- EJB SLSB (RMI-IIOP)
- SCA
- etc.
-Easily extended to
include others
references
Implementation
- Java
- BPEL
- Spring
- Ruby
etc. Easily extended to include others
10
interface
- Java
- WSDL
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software
Assembling
the Group
Mortgage Application
SCA defines a component assembly model
Credit
Bureau
Mortgage Composite
Business
Partner
W
S
Interest
Rate
(EJB)
W
S
Loan
Approval
(Java)
EJ
B
Calculator Composite
JS
O
N
We
b
2.0
11
Risk
Assessment
(Java)
R
M
I
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
R
M
I
Mortgage
Calculator
(Java)
IBM Software Group
Assembly 1 (Departmental)
A composite with five java component implemented in Java
Mortgage Composite
Credit
Check
(Java)
Interest
Rate
(Java)
Loan
Approval
(Java)
Mortgage
Calculator
(Java)
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
targetNamespace="http://mortgage" name="MortgageComposite">
<component name="LoanApprovalComponent">
<implementation.java class="mortgage.LoanApprovalImpl" />
<property name="minimumCreditScore">600</property>
<reference name="creditCheck"
target="CreditCheckComponent" />
…
<reference name="mortgageCalculator"
target="MortgageCalculatorComponent" />
</component>
<component name=“MortgageCalculatorComponent">
<implementation.java class="mortgage.MortgageCalculatorImpl"
/>
Risk
Assessment
(Java)
</component>
<component name="CreditCheckComponent">
<implementation.java class="mortgage.CreditCheckImpl" />
</component>
…
</composite>
12
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Deployment 2 (Cross-division)
CreditCheck is exposed as a Web Service
Interest
Rate
(Java)
Mortgage
Client
(J2SE or JSP)
Loan
Approval
(Java)
Credit Composite
SOAP/HTTP
Mortgage Composite
w
s
w
s
Credit
Check
(Java)
Mortgage
Calculator
(JavaScript)
Risk
Assessment
(Java)
<component name="LoanApprovalComponent">
<reference name="creditCheck">
<binding.ws wsdlElement="http://credit#wsdl.port(CreditCheckService/CreditCheckSoapPort)" />
</reference>
</component>
13
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Deployment 3 (Organizational & beyond)
CreditCheck is an external Web Service
MortgageCalculator is a RMI service shared by other functions
InterestRate is an existing EJB
LoanApproval is exposed as both a Web Service and JSON-RPC service
Credit
Bureau
SOAP/HTTP
Mortgage Composite
Business
Partner
W
S
Interest
Rate
(EJB)
Loan
Approval
(Java)
W
S
EJ
B
Calculator Composite
JS
O
N
We
b
2.0
Risk
Assessment
(Java)
R
M
I
R
M
I
Legends:
Composite
14
Java
Component
JavaScript
Component
Service
Reference
Property
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Non-SCA Client
Mortgage
Calculator
(Java)
IBM Software Group
SCA composition is simple and flexible
No more plumbing API calls in my application code! With SCA, it’s a
matter of declaring bindings and switching at your will.
The business logic is not bound to a pre-defined deployment
topology any more.
B
service
reference
LoanApproval
B
B
B
B
Business logic
RMI/IIOP
15
JMS
Web Services
B
JCA
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
This is cool!
IBM Software Group
Tuscany SCA and Web 2.0
Web 2.0 bindings: JSONRPC, DWR, Feed (ATOM, RSS)
Widget implementation to represent web components and provide
dependency injection for JavaScript
Other scripting implementation types
atom
Interest Rate
Online Mortgage
http
jsonrpc
Loan Approval
16
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Credit Check
IBM Software Group
Enforcing the enterprise capabilities/constraints
Intent: State the QoS requirements in a high-level abstract form, independent of the
detailed configuration of the runtime and bindings
Security: authentication, authorization, integrity
Transaction: managedTransaction.global, noManagedTransaction, supendsTransaction,
propagatesTransaction
Policy: Describe some capability or constraint that can be applied to service
components or to the interactions between service components represented by services
and references.
Business
Partner
Credit
Bureau
Mortgage Composite
W
S
W
S
SOAP/HTTP
Loan
Approval
(Java)
<service name=“LoanApproval" requires="authentication" promote=“LoanApprovalComponent">
…
</service>
<component name=“MortgageComponent">
<reference name=“creditCheck" requires=“integrity">
</reference>
</component>
17
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Handling data representations
Business services talk to each other by data exchange. The same data can be
represented in various formats.
A Customer can be represented as:
o Plain Old Java Bean (POJO)
o SDO Data Object, JAXB object, XML String, DOM Node, StAX XMLStreamReader, AXIOM
o JSON
Tuscany makes the transformation transparent to business component
developers by providing a lot of transformers to convert data between
different formats
Business components can choose their preferred business data
representation
18
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
The Tuscany SCA Java Stack
SCA
Composite
Applications
Composite
Composite
C
C
C
Composite
C
C
C
C
C
C
SCA Spec API
Kernel
SPI
Tuscany API
Extensions
Implementation types
Binding types
Tuscany
Runtime
Databinding types
Intent/Policies
Hosting platforms
Standalone
19
Jetty
Tomcat
Geronimo
Other
JEE
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Tuscany SCA Java 1.0.x
The Apache Tuscany SCA 1.0 release includes implementations of the main SCA
specifications including:
SCA Assembly Model V1.0
SCA Policy Framework V1.0
SCA Java Common Annotations and APIs V1.0
SCA Java Component Implementation V1.0
SCA Spring Component Implementation V1.0
SCA BPEL Client and Implementation V1.0
SCA Web Services Binding V1.0
SCA EJB Session Bean Binding V1.0
It also includes implementations of many features not yet defined by SCA specifications,
including:
SCA bindings for Direct Web Remoting, RSS and ATOM Feeds, HTTP resources, JSON-RPC,
PUB/SUB Notifications, and RMI.
SCA implementation types for OSGi, XQuery, BPEL, and various dynamic languages including
Groovy, JavaScript, Python and Ruby
Databindings for Service Data Objects (SDO), JAXB, XMLBeans, Axis2's AXIOM, JSON,
SAXON, DOM, SAX and StAX
The Tuscany SCA Runtime can be configured as a single node SCA domain or as an SCA
domain distributed across multiple nodes. In addition Tuscany SCA supports the following
host-deployment options:
20
running standalone
running with distributed nodes across multiple JVMs
running with embedded Jetty or Tomcat
running as a standard web application
running as a module in Geronimo (experimental)
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Software Group
How do I IBM
get
Involved ?
Take a look at the latest release from the Apache Tuscany Web site
http://incubator.apache.org/tuscany/
If you want the latest and greatest go to the Apache Tuscany source code
repository
http://svn.apache.org/repos/asf/incubator/tuscany/
Most importantly join the active developer and user communities
http://incubator.apache.org/tuscany/getting-involved.html
You are very welcome to get involved in the project in any way you want to, here
are some examples.
Try out the software and give us your feedback
Record bugs (JIRA) for any enhancements you want or problems you find
Suggest new extensions
Provide those bits of documentation that you think are missing or can be improved
Write some code
Give a summary of how you have used Tuscany
21
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Summary: The benefits of Tuscany/SCA
Improved Business Flexibility
Technology Neutral. The business is able to substitute implementations, or
change protocols, deployment targets or other environmental concerns without
changing the SCA application.
Reuse. Clearly defined, loosely-coupled services are building blocks for
composite applications.
Composition. Services can be composed together through SCA assemblies to
build more complex composite applications.
Adaptability to change. Easy to reconfigure, replace and redeploy.
Improved Developer Productivity
Separation of concerns: The loosely coupled service model with clearly defined
service definitions enables the SOA development team to work in parallel and
independently of each other
Service Reuse: reduces the cost of building new SOA applications
Top-Down Development: Components can be assembled before the component
is actually implemented. The actual component implementation choices can occur
later in the development cycle.
Improved Organization: SCA introduces the notion of composites. A composite
is used to group components together as we build a composite application
Technology Neutral: Reducing the technical skills
Source: http://download.boulder.ibm.com/ibmdl/pub/software/dw/specs/ws-sca/SOAProgrammingModelBusinessValue.pdf
22
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Appendix: A list of demo/tutorial applications
available in Tuscany SCA Java
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/tutorial/
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/demos/
IBM Software Group
Tutorial: The Rise of a Fruit Business
A fast growing Fruit Business
The Fruit Stand
The Fruit Store
The Fruit&Vegetable Store
The Fruit&Vegetable Store as Supplier
The Fruit&Vegetable Store Solution Provider
The business needs a flexible and agile solution that can
quickly and effectively responsive to the business
growth
Tuscany/SCA is here to rescue
24
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
The Fruit Store
Creating an Online Business
store
atom
ShoppingCart
Store
currencyCode=USD
http
jsonrpc
Catalog
25
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Currency
Converter
IBM Software Group
The Fruit&Vegetable Store
Merger or Acquisition
store
Currency
Converter
ShoppingCart
Store
atom
currencyCode=USD
Fruit
Catalog
http
jsonrpc
Catalog
ws
26
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Vegetable
Catalog
IBM Software Group
The Fruit&Vegetable Store as Supplier
Being a Supplier for other Online Stores
store
atom
Currency
Converter
ShoppingCart
Store
currencyCode=USD
http
jsonrpc
Fruit
Catalog
Catalog
ws
ws
AllAroundFoods.com
27
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Vegetable
Catalog
IBM Software Group
The Fruit&Vegetable Store Solution Provider
Providing a Store Solution in another Geography
eustore
ShoppingCart
Store
Currency
Converter
atom
currencyCode=EUR
http
ws
Fruit
Catalog
jsonrpc
Catalog
ws
ws
28
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
Vegetable
Catalog
IBM Software Group
Demo applications
Big Bank
Mortgage Approval
Alert Aggregator
XML version of Big Bank
29
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software
Group
Demo – Big
Bank
Composite
StockQuote
Service
binding.ws
Component
StockQuote
Java
wire
Composite
BigBank
Component
Account
Reference
binding.ws
Composite
Calculator
Service
binding.jsonrpc
Component
Add
JavaScript
Reference
binding.rmi
Java
Component
Account
Data
Java
Component
Calculator
Java
Component
Subtract
Ruby
Service
binding.rmi
Component
Multiply
Python
Component
Divide
Groovy
30
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Demo – Mortgage Approval
31
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
Demo - Alert Aggregator
32
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA
IBM Software Group
XML version of Big Bank
33
Practical
SOA with Apache Tuscany - http://incubator.apache.org/tuscany
Open Source SOA