Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
*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 first develop a simpleunderstand SCA calculatorconcepts application and thenexample enhancewalk itthrough withfor morebuilding advancedyour features and concepts. This guide is based on Java SCA implementation in Tuscany.

It is assumed that you are familiar with basic SCA concepts.

This is a work in progress, so please contribute and comment so we can make this valuable to you own SCA application. 

{section}{column:width=50%}{column}

\\
{panel:title=Apache Tuscany SCA User Guide|borderStyle=solid|borderColor=#6699ff|titleBGColor=#D5EFFF|bgColor=#ffffff}

* [Introduction|#Intro]
* [Quick Guide to SCA |Quick Guide to SCA]
* [Build your calculator application| #build your calculator application]
  ** [get started|#get started]
  ** [Experience running calculator application|#Experience running calculator application]
  ** [Build your  Calculator application in Java|#Build your  Calculator application in Java]
     *** What you will learn
     *** Example walk through
  ** Build a Calculator application using different languages
  ** Build a Calculator application using web services
\\
 
{panel}{section}

h3. {anchor:Intro}{color:#0099cc}Introduction{color}

This user guide will help you become familiar with SCA concepts and walks you through steps of building your SCA application.   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.

h3. {anchor:Build your calculator application} {color:#0099cc}Build your calculator application{color}

We will use the calculator sample to walk through steps for building an SCA application. As the name indicates, this sample performs the calculator operation. It is given two numbers and asked to perform an operation on those numbers. We will start with a simple variation of the calculator example and extend it to include more advanced SCA features.

h3. {anchor:get started} {color:#0099cc}Get started{color}

* Download [Tuscany Java SCA release|http://incubator.apache.org/tuscany/sca_downloads.html].
Please download the latest release. 
* Download prequisits 
  ** [JDK 5.0|http://java.sun.com/javase/downloads/index.jsp]
  ** [Maven 2.04|http://maven.apache.org/download.html]

h3. {anchor:Experience running calculator application}{color:#0099cc}Experience running calculator application{color}

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:
{code}
java -cp target\sample-calculator.jar;..\..\lib\tuscany-sca-manifest.jar calculator.CalculatorClient
{code}

You should see the following result:

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

h3. {anchor:Build your  Calculator application in Java}{color:#0099cc}Build your  Calculator application in Java{color}

h4. What you will learn
This example illustrates how to define the model, define and implement components and wire them to create a composite application called calculator. This example uses the use of SCA to wire components together inside a composite. All connections between the components are local and are defined using Java interfaces.

h4. Example walk through
*Step 1 - Define your application:* Think about how your application can be broken down into smaller functions/services. In this case, calculator application can be divided into four blocks: Add block, Substract block, Multiply block and Divide block. Each block is a logical unit of operation that can be used in the overall application.

*Step 2 - Define components:* 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 in SCA programming model. A component is the smallest unit of function in your application that provides a service. A component can reference other components and can also be referred to by other components. 

Let's start with the add component. A component has an implementation associated with it. This is the program logic that defines the work to be done by this component. This implementation can be in any language, in this case it is a Java implementation.


{HTMLcomment:hidden}{children:sort=creation}{HTMLcomment}