You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 83 Next »

This page is under construction- You are welcome to help and complete it

Welcome to the Apache Tuscany SCA User guide. Here you will find information aimed to help you understand SCA concepts and example walk through for building your own SCA application.


Apache Tuscany SCA User Guide

Introduction">Introduction

This user guide will help you become familiar with SCA concepts and walks you through an example that demonstrate how to build an SCA application. It also describes the different environments that Tuscany supports (such as command line clients or web applications) and how to package up applications to run in these environments.

There's nothing to it really! Building SCA applications is easy. One of the main goals of Tuscany and SCA is to avoid imposing rules and requirements on how people write applications. We want to let people write application code the way they want without being concerned about the environment in which it will be used. After all, writing code to handle plumbing just gets in the way of writing the interesting stuff. So basically, you write the code for interesting bits, and Tuscany provides the environment that lets it run. Therefore, this guide is just an example of how an SCA application can be developed and is not a rule.

Quick Guide to SCA "> Quick Guide to SCA

The quick guide to SCA gives you an overview of SCA concepts and prepares you to work on the example below. You can skip this step if you are already familiar with SCA.

For more details on SCA please refer to the specifications at Open SOA web site.

Overview of Example"> Overview of Example

We will use the calculator sample to walk through steps for building an SCA application. As the name indicates, this example performs typical calculator operations. It is given two numbers and asked to perform an operation on those numbers. Our calculator will handle add, subtract, multiply and divide.

We will start with a simple variation of the calculator example and extend it to include more advanced SCA features.

Get started"> Get started

Experience running calculator application">Experience running calculator application

Calculator is provided as a sample under SCA Java distribution. Let's first run the sample before we go about
buidling it. It is easy!

  • go do the directory ..\samples\calculator
  • issue the command:
    java -cp target\sample-calculator.jar;..\..\lib\tuscany-sca-manifest.jar calculator.CalculatorClient
    

You should see the following result:

3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5

Build your Calculator application in Java">Build your Calculator application in Java

What you will learn

This example illustrates how to define your application while staying focused on the business logic. It walks you through steps of building a composite application called calculator. All connections between the components within the composte are local and are defined using Java interfaces.

Example walk through

Step 1 - Define the building blocks: Think about how your application can be broken down into smaller functions/services. Each block is a logical unit of operation that can be used in the overall application.
In this case, calculator application can be divided into five blocks: Add block, Substract block, Multiply block and Divide block and a main block that takes a request and routes it to the right operation.
Unable to render embedded object: File (CalculatorBlocks2.jpg) not found.

Step 2 - Build each block: Now that you have identified the blocks of functionality in your application, you are ready to create each block. A block is called a component implementation. There are 3 distinct steps in construction phase.

  1. Create component implementation by writing the business logic. No need to worry about How it accesses services.
  2. Define service dependencies without needing to know how it is done.
  3. Defining properties and policies.

For the purpose of this excercise, we will walk through building the add and calculator blocks using Java as an implementation language.

At this point you have identified the IDE you want to use. Here is an example of how the environment can be setup in Eclipse.
[add a page to explain how Eclipse setup can be done - need help for this]

Add link to a page that shows Add component implementation
Add a link to a page that shows calculator implementation

Step 3 - Assemble the calculator application:

Step 4 - Deploy and run the calculator application:

Unknown macro: {HTMLcomment}
  • No labels