2016/05/28 - Apache Tuscany has been retired.

For more information, please explore the Attic.

 
 Apache Tuscany > Home > Menus > General > SCA General Menu > Java SCA Menu > Java SCA Developer Guide User List | Dev List | Issue Tracker  

The Java SCA sub-project aims to provide enterprise-grade service infrastructure based on SCA. Some of our principles include:

  • Tuscany SCA is not just a reference implementation. We encourage innovation based on the tenets of SCA. A lot of work we do provides feedback to the specifications.
  • We build runtimes that are distributed under the Apache Software License.
  • We believe developing highly scalable service-based systems should be easier than it currently is.
  • We believe in providing users with flexibility and choice. We do not dictate programming models but support many. Our runtimes are designed to be highly extensible so users may customize them to fit their needs.
  • We provide frequent releases of our software so users can experience the newest features and have access to the latest bug fixes.

For those looking at or developing the Tuscany Java SCA source code this page provides some description of the code structure and associated conventions that are used.

Getting the Source - Subversion Access

The Java SCA project Subversion repository is located at https://svn.apache.org/repos/asf/incubator/tuscany/java/sca.

The respository can also be viewed online at http://svn.apache.org/viewvc/incubator/tuscany/java/

Anyone can check code out of Subversion. You only need to specify a username and password in order to update the Subversion repository, and only Tuscany committers have the permissions to do so.

Checking out from Subversion

Use a command like:

svn checkout https://svn.apache.org/repos/asf/incubator/tuscany/java/sca

Committing Changes to Subversion
Any Tuscany committer should have a shell account on svn.apache.org. Before you can commit, you'll need to set a Subversion password for yourself. To do that, log in to svn.apache.org and run the command svnpasswd.

Once your password is set, you can use a command like this to commit:

svn commit

If Subversion can't figure out your username, you can tell it explicitly:

svn --username <name> commit

Subversion will prompt you for a password, and once you enter it once, it will remember it for you. Note this is the password you configured with svnpasswd, not your shell or other password.

Getting Setup for Development

Prerequisites
Java SCA requires the following:

Some Definitions

Module - we use the term module to refer to a leaf of the maven build tree. I.e a directory containing source code and resources that will be compiled to a releasable artifact, e.g. a jar file.

...

Source and Build Structure

Looking at the source code for Java SCA you will see the following directory structure.

java/
 pom/parent/pom.xml
 ...
 sca/
   pom.xml - The maven pom that builds all of the releasable Tuscany Java SCA modules

   contrib/ - A temporary direcoty that holds modules not currently being developed or targetted for a release
     ...

   doc/ - Tuscany Java SCA documentation that will be included with the release
     ...

   itest/ - Integration tests that test system performace using combinations of Tuscany Java features
     pom.xml
     ...

   modules/ - A flat direcory structure holding all of the separate modules that make up Tuscany Java SCA. 
     pom.xml
     ...

   samples/ - Tuscany Java SCA samples which show how to use the various features of the software
     build.xml <-- Samples build with Ant as well as Maven - TBD
     pom.xml
     ...

Naming Conventions

  • Use all lowercases and dashes in folder names (like in the jar names)
  • Maven artifact id = tuscany-<folder name>
  • Package names within modules should include the module name so that source code can be located in the source tree easily. So, for example, the module
java/sca/module/implementation-java

contains code in the package structure

org.apache.tuscany.implementation.java.*

Module Location

If people want to work on some new modules that won't be part of the
next release and are not included in the top-down build, that's fine, we can
just avoid listing these modules in java/sca/modules/pom.xml. So, they
can be there in the same source tree but they won't break the release
top-down build, and they won't have to be building at all times.

Maven Build Structure

  • sca/pom.xml's parent will be pom/parent/pom.xml
  • Other poms will use the pom from the parent folder as parent pom
  • Group ids:
    org.apache.tuscany.sca
    org.apache.tuscany.sca.samples,
    org.apache.tuscany.sca.itest
  • Version of our modules will be specified once in java/sca/pom.xml, child poms don't need specify a version as they get it from their parent
  • pom names begin Apache Tuscany SCA
  • Eclipse projects are generated for all built modules using mvn -Peclipse eclipse:eclipse

Building From The Source

First of all check out all of the java source code.

svn checkout https://svn.apache.org/repos/asf/incubator/tuscany/java

Building the SCA source code is simple

cd java/sca
mvn

It should work even if you start with an empty Maven local repository, and it should always work. This assumes that maven is able to retrieve a SNAPSHOT version of SDO (and of course the rest of software that SCA depends on) as we haven't built anything other than SCA here. There can be occasional problems downloading artifacts from remote Maven repositories so if mvn fails with network related sounding messages sometimes just trying again can fix the problem.

Coding style and Testing

Tuscany has some basic coding standards - use spaces not tabs, keep a reasonable line length, and include enough comments in the code. Tests are good, both unit and functional testing is encouraged. When modifying existing code try to use the style already in place or if necessary reformat the whole file so the style is consistent.

The ASF has some requirements on the license header that should be included in most files, for details see http://www.apache.org/legal/src-headers.html.

In the Tuscany SVN there is a folder tuscany/java/etc which contains various templates that can be used to configure your development environment, for example, codestyle template files which can be imported into the Eclipse or IDEA IDE's. Some Tuscany modules are set up to use the Maven Checkstyle facility which may be run using the Maven -Psourcecheck option.

website stats