Initial Design

The aim of the DCC web application was to create a web base application that could run on a raspberry pi and interface with a DCC controller and allow the controller of locos and accessories.

OK This does sound a lot like JMRI but I found that JMRI did not have some features that I wanted to include, I did try looking at the java code to see if I could implement the features that I wanted within JMRI but found the architecture that JMRI to be a little bit…  Lets just say I decided to start from scratch.

So first things first I decided on the frameworks that should be used to create the application.

Spring boot was an obvious choice for dependency injection and the Restful services.

For the web interface I choose AnguarJS and bootstrap for the css framework.  Not long after starting Angular 2 was released and so I quickly decided that interface should be moved to using the newer Angular 2 and write the interface code using typescript rather than javascript.

So for the database I decided on using a basic derby database with a spring JPA implementation.  The reason behind the basic derby database was to keep the installation to a bare minimum without the need to setup mysql or similar on the raspberry pi before installing the web application.

To build the application and run the unit tests I decided on the tried and trusted Maven.  As for the the unit tests these are written using JUnit4 and also utilise Mockito to mock objects that are not being tested in individual tests.

Finally Jenkins to automate builds and run the static analysis which I decided to use SonarQube to keep an eye on the code quality and the unit test coverage.

And that pretty much covers the initial design decisions.

Leave a Reply