There is still a lot of work to do, so we try our best to get everything done in time. This week we should fill in the SAD-document with some diagrams. You can find this document here. Most likely we will change some parts of it in near future because we try to generate as much of those diagrams automatically based on our code. But our code is in an very early stage so there will be lots of changes.
Spring as MVC Framework
For our project we decided to use Spring Boot which includes the Spring MVC framework. Therefore, our project should match the MVC structure by default. The following image shows the structure of a normal Spring MVC application. The only difference in our case is that we return an object as “view” and not a html page.
As Spring is a very popular framework there are some tools out there to generate a CRUD application with only a few clicks. One of those tools is JHipster just to mention one example. But our application doesn’t fit the CRUD schema very well, so we took another approach.
Code generation with Swagger
The Spring application is only one half of our project. The second part is a single-page Vue.js application to visualize our data, as described in a previous blog post.
Therefore we had to design a REST-API for communication. To achieve this we used Swagger which allows us to define endpoints, parameter and transmitted objects in a YAML-format. Then Swagger uses this configuration to generate a lot of our needed Java-classes which will be the base for future development. Beside this generated code you will also get a well-organized documentation for your API which even allows interactive testing by sending some dummy requests to the server. So if you need to design an RESTful API you should definitely check it out.
Looking forward to some feedback.