use all the power provided by Spring boot and java 11 + code refactor (inject services instead of writing the business logic in the controller)
tht0urist opened this issue · 1 comments
tht0urist commented
Hello from France !
I checked some Java classes (Rest Controllers) and I think that you should use more spring boot /java 11 features such as java streams, @ControllerAdvice for exception translation, SQL queries with Hibernate or Spring data JPA, use @service to implement the business logic and test it with JUnit easily.
In addition to that, use yaml style instead of .properties file because that it's easier to read and to modify (clarity purpose) :)
martinalig commented
Thanks for your inputs.
In general, you are welcome to make pull-requests for improvements.
Some comments about your inputs:
- We try to use streams where it helps and makes the code more readable
- We are aware of @ControllerAdvice. At the moment we handle various exceptions with @ExceptionHandler
- The project has a very simple database schema. We do not think that using an ORM helps much here and writing precise queries is more optimal in that case.
- We are no big fans of YAML ;)
But as I said, you are very welcome to make improvements via pull requests.