Next >

SCA 1.0 Spring tutorial

Learning objectives

This tutorial takes you step by step through creating an SCA 1.0 application that uses Spring applications as implementations for SCA components. In this tutorial you will learn to create and deploy an SCA assembly that uses Spring applications as implementation types for SCA components and to connect Spring applications together as SCA components using services, references, and wires. SCA 1.0 applications are applications that conform to the SCA 1.0 (OSOA) specification.

In this tutorial an SCA application is developed using three separate spring applications as component implementations. The application will provide weather information and uses the following Spring bean files for the implementations: Convert.xml, Temperature.xml, and Weather.xml. Each spring application does not have knowledge of the other spring applications.

The Weather and Converter applications both have a references to the Temperature application defined using a Spring ref attribute. The Temperature application does basic temperature conversion and provides this information as a service to the other applications. These references to the Temperature application are specified in spring definition files, however, the spring runtime does not have enough information to resolve these references. SCA is used in this tutorial resolve and connect the Weather and Converter applications with the Temperature application.

The Temperature application converts a farhenheit float value to a celsius float value. The Weather application takes in a farhenheit float value and returns a string that talks about the weather. The string returned includes the temperature which has been converted to celsius. The Converter application does something similar. It takes in a float value and returns a string. The difference between the Weather and Converter application is in how the reference to the Temperature application is specified. Spring provides two ways to define a reference. The Weather application uses a constructor argument. The Converter application uses a property element to define the reference.

Restriction: This sample does not run on IBM® WebSphere® Application Server Developer Tools for Eclipse
To complete this tutorial, you will need approximately 60 minutes.

Prerequisites

  • Have installed IBM Rational Application Developer v7.5.5. or later. If you are using v7.5.5 you also need the feature pack for Service Component Architecture Development Tools.
  • Have installed the IBM WebSphere Application Server Version 7.0 Test Environment v7.0.0.7, or later. If you are using v7, you are need the feature pack for Service Component Architecture.
  • Have installed the Spring runtime 2.5.5 or 2.5.6 from http://www.springsource.org/download
Next >

Feedback