Tuscany's code base contains 49 example programs in the Samples directory: For beginners, and for developers who want to learn about SCA and Tuscany, these examples are very good content. I'm here to give you a brief introduction.
The Tuscany example uses the following directory structure:
Src
Main
Java (contains source files for all classes in the example)
Resources (contains all the resource files in the example)
Test
Java (test case)
To run these examples, you must first install MAVEN2 and add Maven's Bin directory to the system running path, as with JDK 1.5 and 1.6.
Calculator series
Calculator
This example is the beginning of the understanding of Tuscany and SCA, and the SCA illustration of this example is everywhere, and I am no longer available here. The example includes a composite file, which is the implementation definition and reference relationship definition of all the artifacts in this example, which is the basis of SCA assembly; Run this example to run the MVN in the calculator root directory. Let's take a look at this test case, the diagram below is its sequence diagram.
Figure: First initialize the Scadomain, then obtain the Calculatorservce instance from Scadomain, and then test each method of the instance.
calculator-distributed
Calculator-implementation-policies
Calculator-service
Calculator-rmi-reference
Calculator-script
Calculator-webapp
Calculator-ws-webapp