The ACME Project

From GCube System
Revision as of 00:33, 11 April 2008 by Fabio.simeoni (Talk | contribs)

Jump to: navigation, search

You may have noticed that there is no provision for service dependencies (typically, jar archives of classpath resources, typically classes). In a word, you may be wondering where is the classic lib folder. First, notice that there are two broad kinds of dependencies to consider:

  • the standard dependencies, i.e. dependencies to binaries which ship with the gCore distribution and can be found below the gCore location ('$GCUBE_LOCATION/lib'). The first and foremost dependency of this kind is of course to the gCF jar (org.gcube.common.core.jar), though there are plenty more pontentially available.
  • the custom dependencies, i.e. the dependencies which are specific to the service and whose binaries cannot be guaranteed to be part of a gCore installation. The first and foremost custom dependency of every service is to its own stubs, as we shall see soon.

Clearly we need to worry only about custom dependencies. Standard dependencies are already somewhere and all we need to do is to point Eclipse to them. A clean way of doing this requires to:

  • create a user library, say GCORELIBS, at the workspace level (Preferences/Java/Build Path/User Libraries/New...) and populate it with all the binaries in $GCUBE_LOCATION/lib (Preferences/Java/Build Path/User Libraries/Add Jars...).
  • specify a single dependency to GCORELIBS in each and very service in the workspace (Properties/Java Build Path/Libraries/Add Library.../UserLibrary).

So, back to custom dependencies. The idea is to follow an unconventional strategy and keep them outside the service location. The main reason for this is that there are tools for the management of custom dependencies to other gCube services which are most conveniently used if we keep those dependencies outside the service location. This will become clear later on, when we will look at those tools. For the time being, just take our word for it. So:

  • create a generic Eclipse project Dependencies and a folder SampleService right under it. The idea here is to have a single project to group the custom dependencies of all the service in the workspace, to dedicate its sub-folders to individual services, and to place custom dependencies in each folder as they become manifest during service development.
  • create another user library SAMPLESERVICEDEPS in Eclipse and add it as a single dependency to SampleService. For the time being this library is empty, but we will populate it with all the custom dependencies we place in "Dependencies/SampleService.

You should end up with something like this:

|- SampleService
|--etc
|--src
|--schema
|
|-Dependencies
|--SampleService