Skip to content
DavidLeoni edited this page Feb 24, 2017 · 2 revisions

Ide setup

Guidelines

Logging

Documentation


In this wiki we only put information about development of Diversicon. For usage information please refer to the project website

IDE setup

As IDE we currently prefer Eclipse

Java and Maven

We use JDK 7 and Maven 3.3.9

Eclipse

Eclipse seems to have less problems than Netbeans in handling Immutables annotations.

Eclipse Setup

File->Import->Maven->Existing Maven project -> select directory where project is -> Click finish

Eclipse formatting
  • download tod-eclipse-format-style.xml file from <a href="../blob/master/tod-eclipse-format-style.xml" target=_"blank">tod-commons repository
  • set the project format style:
right click on newly created project 
-> Properties 
-> Java Code Style 
-> Check Enable project specific settings 

Then as Active Profile, choose Import...  and select  the previously downloaded file.
Eclipse issues

If there are issues in compiling, try the following:

  • update the project frequently with Project->Clean
  • select the project in Project Explorer and hitting F5
  • select the project in Project Explorer and select Delete (will not delete project from disk unless you explicitly say so in pop up). Then do File-Import -> from Maven

Netbeans

Setup

  • Install Netbeans 8.0.2
  • todo write about md plugin?

In theory you just need to open the project and that's it.

Guidelines

Relation with Uby

Diversicon should only be a thin wrapper over UBY 0.7.0, so we don't want to add many dependencies or do weird stuff. Diversicon class extends Uby. for LMF XML to import we use the format specified by the Uby DTD 0.7.0 .

Name casing

We follow Google's naming coding style.

Libraries

We try to keep Diversicon as self-contained as possible. When a feature is not satisfactorily covered by vanilla Java 7 we copy/paste from Guava library . Code must work in a Java 7 environment.

Null values

Null values are generally avoided and empty objects used instead. When no good empty object is found (for example for dates), we use null, marking type with JSR-305 @Nullable annotation (we considered using Guava's Optional<T> but is a bit verbose and might give issues with json serialization)

Exceptions

We don't use checked exceptions (the ones inheriting from Exception) and prefer runtime exceptions (that inherit from RuntimeException), so users can avoid try-catch boilerplate. Thrown exceptions MUST be properly documented.

Logging

We use SLF4J API. As implementation during testing, we use Logback.

In tests we provide logback as slf4j implementation. They are configured by default via XML files looked upon in this order :

  1. whatever is passed by command line: mvn test -Dlogback.configurationFile=path-to-my-logback.xml
  2. conf/logback-test.xml as indicated in Maven surefire plugin configuration
  3. logback-test.xml in test resources.

CAVEAT: stupid Eclipse doesn't pick those Surefire properties by design , nor allows to apply run settings to all tests (O_o) so I went to Windows->Preferences->Java->Installed JREs->Default one->Edit and set default VM arguments to -Dlogback.configurationFile=conf/logback-test.xml. It's silly but could somewhat make sense for other projects too.

Documentation

For documentation we use the program Josman and follow its guidelines.