This article will provide information that may be of interest to people who are interested in contributing to the SAVARA project.
NOTE: This is a work in progress, so information will be added as and when required.
Some Coding Conventions
Logging
The project uses the java.util.logging framework that is part of the JDK. Although this may not be the most efficient logging approach, or favourite amongst developers, it has the obvious advantage that it has no additional dependencies other than the JVM.
When considering that the core SAVARA modules are OSGi bundles, and therefore need to be deployed either packaged with dependent jars, or require them to be deployed in other bundles, it makes sense for these bundles to only deploy on essential third party jars.
When recording information that is relevant to a user, than the messages should be stored in a Messages.properties file in the module's src/main/resources folder, in a package named after the module. So for example, the org.savara.scenario module would have a file in the source: src/main/resources/org/savara/scenario/Messages.properties.
The contents of the Messages.properties file will be a set of name/value pairs, e.g.
SAVARA-SCENARIO-00001=Simulated role ''{0}'' does not have a context
where the 'name' portion is a code of the form SAVARA-<ModuleCode>-<5-digit-number>.
The message itself can contain parameters supplied when reporting the message, using double single quotes on either side of a set of curly braces containing the index of the parameter.
An example of using this message in the code would be:
Role role=....; String mesg=MessageFormatter.format("org.savara.scenario", "SAVARA-SCENARIO-00001", role.getName());
The MessageFormatter utility function is found in the org.savara.common module, in the org.savara.common.logging package. The first parameter represent the module associated with the message, and the second parameter is the message code, and the zero or more following parameters represent the optional parameters for use in the message.
Comments