270 likes | 483 Views
Building SOA With Apache Tuscany http://incubator.apache.org/tuscany/. JavaZone ‘07 - September 2007 Simon Laws (Apache Tuscany Committer) simon_laws@uk.ibm.com simonslaws@googlemail.com slaws@apache.org. What We Are Going To Cover. The problem we are trying to solve
E N D
Building SOA With Apache Tuscanyhttp://incubator.apache.org/tuscany/ JavaZone ‘07 - September 2007 Simon Laws (Apache Tuscany Committer) simon_laws@uk.ibm.com simonslaws@googlemail.com slaws@apache.org
What We Are Going To Cover • The problem we are trying to solve • Building SCA applications • What’s inside the Apache Tuscany box?
What’s The Problem TraditionalBusiness* : tightly integrated Flexible business requires flexible IT • Economics: globalization demands greater flexibility • Business Agility: daily changes vs. yearly changes. Need to efficiently react to change. • Reusable assets can cut costs down • Need to embrace latest technologies where possible • Competitive pressure • Cost of maintenance, ease of development and management Today’s World-Class Business*: Loosely coupled services *Sources: CBDi
Apache Tuscany and the Service Component Architecture Apache Tuscany provides a simpler experience for developers who want to create applications using a service-oriented approach to address the issues of Flexibility Business Agility Reusing existing assets Integrating with existing and future technologies Simplifying application construction and maintenance Apache Tuscany achieves this by implementing the Service Component Architecture (SCA) specifications in Java and C++ SCA is specification developed by 17 companies at www.osoa.org and now going through a formal standardization process in the OASIS Open Composite Services Architecture working group SCA embodies good practice for SOA in a programming, assembly and deployment model
What Does SCA Do? Imagine some distributed application made up of a number of components • Each component has some • business function Components expose services Components reference other services • Components are wired • together and grouped logically • Components are contributed • to physical runtimes SCA Defines a simple model for component construction, assembly and deployment.
property An SCA Component publicclass CalculatorServiceImpl implements CalculatorService { @Property private int decimalPlaces; @Reference private AddService addService; @Reference private SubtractService subtractService; @Reference private MultiplyService multiplyService; @Reference private DivideService divideService; … publicdouble add(double n1, double n2) { return round(addService.add(n1, n2), decimalPlaces); } … service references binding Web Services, EJB SLSB (RMI-IIOP) SCA JMS Atom/RSS JSONRPC binding Web Services, EJB SLSB (RMI-IIOP) SCA JMS Atom/RSS JSONRPC Implementation - Java, BPEL. Spring, Ruby, JavaScript, …
Composite StockQuote Assembling An Application Component StockQuote SCA is the component model Service binding.ws Java wire Composite BigBank Component Account Reference binding.ws Composite Calculator Component Add Service binding.jsonrpc JavaScript Reference binding.rmi Java Component Calculator Component Subtract Java Component Account Data Ruby Service binding.rmi Java Component Multiply Python Allows you to assemble tightly coupled components Component Divide But primarily focused on loosely coupled components Groovy
The Assembly Mechanism – XML Defined By SCA <composite xmlns="http://www.osoa.org/xmlns/sca/1.0“ ... name="Calculator"> <component name="CalculatorServiceComponent"> <service name="CalculatorService"> <tuscany:binding.rmi host="localhost" port="8099" serviceName="CalculatorRMIService"/> </service> <implementation.java class="calculator.CalculatorServiceImpl"/> <reference name="addService" target="AddServiceComponent" /> … </component> <component name="AddServiceComponent"> <implementation.script script="calculator/AddServiceImpl.js"/> </component> … </composite>
The Service Reference <component name="AccountServiceComponent"> <service name="AccountService"> <tuscany:binding.jsonrpc uri="/AccountJSONService"/> <binding.ws uri=“http://localhost:8082/services/AccountWebService”/> <binding.sca/> </service> <implementation.java class="bigbank.account.AccountServiceImpl"/> <reference name="calculatorService"> <tuscany:binding.rmi host="localhost" port="8099" serviceName="CalculatorRMIService"/> </reference> <reference name="stockQuoteService"> <binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/> </reference> <property name="currency">EURO</property> </component>
Composite StockQuote Demo – Big Bank Component StockQuote Service binding.ws Java wire Composite BigBank Component Account Reference binding.ws Composite Calculator Component Add Service binding.jsonrpc JavaScript Reference binding.rmi Java Component Calculator Component Subtract Java Component Account Data Ruby Service binding.rmi Java Component Multiply Python Component Divide Groovy
Reference binding.WS Reference binding.rmi Reference An ESB Reference Binding.sca Service binding.WS Service binding.rmi Service An ESB Service Binding.sca Bindings Component Calculator Component Account Java Java Policy intents can be applied to bindings independently
SCA Domains Domain Node Node Domain Node Node Node Node Node A single Node Multiple (Distributed) Nodes
Leveraging The SCA Domain - Calculator Again <composite xmlns="http://www.osoa.org/xmlns/sca/1.0“ name="Calculator"> <component name="CalculatorServiceComponent"> <implementation.java class="calculator.CalculatorServiceImpl"/> <reference name="addService" target="AddServiceComponent" /> <reference name="subtractService" target="SubtractServiceComponent" /> <reference name="multiplyService" target="MultiplyServiceComponent"/> <reference name="divideService" target="DivideServiceComponent" /> </component> <component name="MultiplyServiceComponent"> <implementation.java class="calculator.MultiplyServiceImpl" /> </component> <component name="DivideServiceComponent"> <implementation.java class="calculator.DivideServiceImpl" /> </component> </composite>
The Distributed Components <composite xmlns="http://www.osoa.org/xmlns/sca/1.0“ name="Calculator"> <component name="AddServiceComponent"> <implementation.java class="calculator.AddServiceImpl" /> </component> </composite>
Deploying SCA Applications • There are several ways that the Apache Tuscany runtime can currently be deployed • Stand alone (1 or more nodes) • Embedded, in the likes of Tomcat, Geronimo etc • As a web application + Hot update option • SCA applications (Java files, SCDL and other resources) are contributed to the runtime. • The runtime makes services available according to the bindings specified in the assembly description (SCDL) NodeImpl node = new NodeImpl(domainName, nodeName); node.getContributionManager().startContribution(URL to my contribution);
Databinding - Service Data Objects Typically within a single process Data Graph DataObject Data Object Graph Data Access Service Change Summary Apache Tuscany also implements SDO and DAS in Java and C++ Can be used to represent complex types passing through services and references Tuscany SCA Java databindings allow other technologies to be used, e.g. JAXB
Other Points Of Interest • SCA simplifies the use of policy to control infrastructure configuration • Interaction policies affect contract between service provider and consumer • Authentication, Encryption, Non-Repudiation, Reliable Messaging, … • Implementation policies affect contract between component and container • Authorization, Transactions, Monitoring & Logging, … • Support is at early stages in Apache Tuscany • Not all of your application has to be written using SCA, • SCA applications can be called (and it can call) applications using any of the available binding technologies • SCA components can easily be used to wrap existing technologies • You don’t need a new project to get benefit from Apache Tuscany and SCA
Why Use SCA? • Embodies good practice for SOA • Provides flexibility by decoupling implementation technology choices from business service definitions • Enables reuse through composition of existing service assets into new service definitions with reconfigurable properties • Brings together a wide variety of new and existing assets into a consistent architecture • Widely supported by middleware vendors and open source implementations
What’s In The Box (http://incubator.apache.org/tuscany/)? Java SCA 0.99 incubating SDO 1.0 incubating DAS 1.0 incubating M2 C++ SCA 1.0 incubator M3 SDO 1.0 incubator beta1 DAS under construction There is also asister project at Pecl.php.net/sca_sdo PHP SCA_SDO 1.2.2 Apache Tuscany Java SCA V1.0 Incubating Is Imminent
Running A Sample From The Binary Java SCA Distribution Download apache-tuscany-sca-0.90-incubating.zip/tar (and check signature) Unpack the zip or tar
Component Implementation Types BPEL DAS Java Notification OSGi Resource Script (Groovy, Ruby, Python, Javascript) Spring XQuery Hosting Geronimo Jetty OSGi Tomcat Binding Types Ajax Feed (RSS, Atom) JMS JsonRpc Notification OSGi Rmi SCA Ws/Axis2 XQuery Databindings Axiom Jaxb Json Saxon Sdo XmlBeans Tuscany Modules There is a wide selection of modules in various stages of development . There is lots more to be done. Come and join Tuscany.
Extensibility • SCA Tuscany is based on an extensible, modularized architecture that can easily be extended. • There is a stable SPI defined for adding new technologies, e.g. bindings, databindings, implementations and hosting support. • If you find that SCA doesn’t support your technology of choice check with the Tuscany mailing list (see “How to find out more”) as it may already be in development and you could help develop or test it. • Alternatively it’s not too hard to add new ones yourself and you could come and help Tuscany build it • All contributions are most welcome!
Use Cases • We are seeing people on our mail list who are using it for real now. For example, • A solution provider is building a service oriented solution for the finance industry. • Includes finance specific message formats • Driving requirements for policy support • Independent product developers are using it as a component composition model to allow their products to be delivered in a way that • Allows the product to run as a set of distributed services • That can be tailored to meet each customers needs and integrated easily into existing customer infrastructure • And that can be extended as requirements change • A platform for modelling the composition of the various steps (and load balancing required) in an analytics chain
How Do I 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 repositoryhttp://svn.apache.org/repos/asf/incubator/tuscany/ • Most importantly join the active developer and user communities on our mail lists by sending mail to tuscany-user-subscribe@ws.apache.org and/or tuscany-dev-subscribe@ws.apache.org or find us on the various archives • You are most 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
Summary • SCA embodies good practice for the construction, assembly and deployment of service-oriented solutions • The open source Apache Tuscany provides Java, C++ runtimes now • If you want to try it in PHP take a look at the PHP SCA_SDO PECL extension • Give the software a spin and tell us what you think
How To Find Out More • Apache Tuscany Web site and downloadshttp://incubator.apache.org/tuscany/ • Apache Tuscany source code repositoryhttp://svn.apache.org/repos/asf/incubator/tuscany/ • Mailing List, send mail to tuscany-user-subscribe@ws.apache.org and/or tuscany-dev-subscribe@ws.apache.org or find us on the various archives • PHP Implementation of SCA and SDO http://pecl.php.net/SCA_SDO • Open SOA Collaboration (SCA and SDO specs and articles)http://www.osoa.org (soon to be -