Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Introduction

Many articles have been written about SOA and Service Component Architecture already12. This article focuses on a freely available, open source implementation of the Service Component Architecture that provides a simple way to implement SOA solutions. This SCA implementation is being developed in the Apache Tuscany Incubator project. The project started in 2006 and is being used by many who are looking for a simple SOA infrastructure. The recent Apache Tuscany SCA version 1.0, which was released in September 2007, supports the Service Component Architecture specification 1.0. In addition to implementing the SCA specification, Tuscany is also a nursery for new ideas. Some of these ideas will find their way into the specifications and some will be regarded as extensions available in Apache Tuscany. For example, support for Ruby, JavaScript, XQuery, Web2.0 and distribution are currently extensions beyond the specification.

This article will walk you through what is available in Apache Tuscany and therefore highlight the benefits of SCA.

Using Tuscany SCA

A Common Approach To Application Construction and Deployment

Enterprise software development is increasingly influenced by technology choices, regulations, competition and expectations for responsiveness to change. Enterprises need the flexibility to adopt new business practices (like outsourcing of mortgage handling by a bank), enforce new regulations and extend or down-size without much cost (mergers and acquisitions). In addition, as the complexity of the enterprise grows, a common management paradigm becomes a necessity for managing business applications. Service Component Architecture provides a simple programming model to address these challenges. SCA's simple language maps easily to the business. Let's consider we are building a banking application that handles account inquiries. The following table maps business level questions to SCA.

...

The following sections describe Tuscany SCA in the context of three familiar scenarios. It should be noted that Tuscany SCA is not restricted to these scenarios. The sample code and configuration used here can be found in the Tuscany SCA Java distribution 3 and is available under the Apache License 4.

Enterprise Applications

In a typical enterprise, business functions are implemented using various technologies, business data is represented in different formats and business applications communicate using heterogeneous protocols. It is almost impossible to converge all applications onto one technology stack such as web services and so it remains difficult and costly to integrate different applications in an enterprise. Enterprises face many challenges including the following.

...

The combination of implementation types available, in particular Spring and OSGi, offers powerful capabilities for building service implementations from sets of simple Java Beans using very few APIs, with managed dependencies, version control and dynamic update capabilities. Such implementations can easily be composed with other service components written in Java or in other languages and all components are deployed consistently in a distributed network of Tuscany SCA runtimes with the full range of communication methods made available to them.

Enabling Web 2.0

A typical Web2.0 application will reference several services in the organization and integrate the provided data in the browser. Tuscany SCA enables such services using popular technologies such as JSONRPC, RSS and Atom protocols.

...

Based solely on this information Tuscany SCA makes three things available automatically;

  • The Catalog JSONRPC service
  • The JSONRPC service description (SMD)
  • A generated Javascript JSONRPC proxy for accessing this service

A browser based application can access this service directly using either the generated JSONRPC proxy or whatever JSONRPC client the application developer is familiar with, for example, the store sample uses the following javascript:

...

Tuscany SCA supports other modes of operation that will be of interest to Web2.0 application developers. For example, the Tuscany Java SCA Chat sample 9 uses binding.dwr to implement a Direct Web Remoting 10 connection between a Javascript browser based application and an SCA service. Using this binding, service to browser communication is supported alongside browser to service communication.

Data integration

In a typical enterprise, business data comes from many different sources and is presented in many different formats. Tuscany SCA provides a databinding framework which seamlessly handles data format mapping and therefore freeing the developers from such concerns.

...

Code Block
    <component name="StockValue">
        <tuscany:implementation.xquery location="stock.xq" />
    </component>

Deploying Tuscany Solutions

The service oriented approach to building applications promotes the benefits of deploying running solutions as a collection of loosely coupled services. Tuscany Java SCA provides a runtime that will host these loosely couple services in a single JVM or across multiple JVMs.

...

Choosing how to run the Tuscany SCA runtime depends on your local environment but there are several options currently supported. NEED A STRONGER STATEMENT HERE. Can we say The Tuscany SCA runtime can be emebedded embedded or run with any available web application servers or web serversserver. The following are available with release 1.0 of Tuscany: Tomcat, Geronimo, Websphere, ...

...

Tuscany V1.0 release has been tried with Tomcat, Apache Geronimo and IBM® WebSphere® application servers. There is work ongoing in the Apache Geronimo project to provide deeper integration between the Tuscany SCA runtime and the Geronimo Management Console.

It is also straightforward to use the Tuscany SCA runtime directly in your applications. It is simply a matter of starting the runtime and providing SCDL and associated component implementations collected together in what SCA calls a contribution (a jar file or directory).

...

Getting Started With Your Own Project

The easiest way to get started with Tuscany SCA is to download the latest release 3 and try some of the samples.

The Java SCA web page TODO 11 provides user documentation and extension guideguides. The User Document provides a simple walkthrough of the Tuscany Java SCA Calculator sample. There is also a paper giving detailed instructions of how to build the simple Web2.0 application described in this paper8.

...

Returning to the business questions we discussed earlier in the paper your application development process will involve some of the following steps. The order of the steps can vary since Tuscany SCA allows a top-down or bottom-up development approach. DOES THIS SOUND OK?

Model the application in a ".composite" file.SCDL

  • 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 in the SCDL.

...

  • 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

The application model and its component implementation dependencies can now be contributed deployed to the Tuscany SCA runtime. CONTRIBUTION IS NEW TO THIS PAPER. HOW ELSE CAN THIS BE SAID

I am wondering if we really need to have this kind of detail here. User doc covers these steps, why repeat it?

Summary

In this paper, we selected a few scenarios to demonstrate some of the powerful aspects of SCA programming model and how it applies to the real world. Apache Tuscany currently implements version 1.0 of the specification and extends the SCA programming model with its support for many different protocols (bindings), different component implementation types and runtime environments. It can be embedded as a solution or run standalone. Apache Tuscany's modular and extensible architecture makes it possible to easily incorporate new ideas. Many businesses are using Apache Tuscany and their feedback is helping to solidify Apache Tuscany as a simple SOA infrastructure as well as making it a nursery for new ideas. You are welcome to come and try the software and contribute to the project.

References

1 Real SOA - Web Services and Service Oriented Architecture, http://www.java.sys-con.com/read/299972.htmImage Removed
2 What Is SCA, http://www.java.sys-con.com/read/325183.htmImage Removed
3 Tuscany SCA Java downloads, http://incubator.apache.org/tuscany/sca-java-releases.htmlImage Removed
4 Apache License Version 2.0 , http://www.apache.org/licenses/LICENSE-2.0Image Removed
5 From the Tuscany SCA distribution 3 look for demos/bigbank-account
6 From the Tuscany SCA distribution 3 look for sample/helloworld-ws-service-secure
7 From the Tuscany SCA distribution 3 look for samples/store
8 Getting Started With SCA - Store - http://incubator.apache.org/tuscany/sca-java-10-incubating-release-summary.data/getting-started-1.0.pdfImage Removed
9 From the Tuscany SCA distribution 3 look for samples/chat-webapp
10 Direct Web Remoting - https://dwr.dev.java.net/Image Removed
11 From the SCA distribution3 look for DocumentationsDocumentation

Acknowledgements

A big thank you to the Apache Tuscany Incubator community.

IBM and WebSphere are trademarks of International Business Machines Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.