This document describes conventions for developers that create distributed services using Rio and either Gradle or Maven. Using conventions for the development of services makes it easier to deploy and use services. The following conventions are discussed:
- Project modules
- Project files
In a nutshell, a service development project should be built as multi-module project, that reflects the basic architectural elements of a distributed service. Given a service artifactId name of hello, the service project is composed of the following modules:
The hello-api module contains all the classes (interfaces and other classes) that is needed to communicate with the service
The hello-proxy module (optional), depends on the hello-api module, and provides smart proxy support
The hello-service module, depends on the hello-api module (or hello-proxy module if used) provides the backend service implementation.
The hello-rule module (optional), depends on the hello-api module and provides support for rules associated with the service.
The hello-ui module (optional), depends on the hello-api module and provides support for a service user interface.
In it's simplest form, the module hierarchy structure is as follows:
Adding a smart proxy to the mix, the module hierarchy structure is as follows:
Following this pattern, you can add additional modules outlined above.
The directory and file layout for the multi-module project is as you would expect. Using the example hello service from above, we would have
hello |-- pom.xml `-- src |-- main | `-- opstring | `-- hello.groovy | |-- hello-api | |-- pom.xml | `-- src | `-- main | `-- java | `-- hello-service |-- pom.xml `-- src |-- main | |-- java | `-- resources | `-- test |-- conf `-- java
- The operational string (opstring) file is in the parent hello project, in the src/main/opstring directory.
- The hello module typically produces an OAR file as an artifact using the Rio Maven Plugin.
- Configuration files for the service should be put into the hello-service module, in the src/main/resources directory. The configuration can then be loaded as a classpath resource.
- Integration testing is performed in the hello-service module.
- Test case configuration is found in the hello-service module, in the src/test/conf directory.