Server-side source code

The server-side code is situated in the Java and resources folder under src/main, as seen in the preceding screenshot. The folder structure is as follows:

You may notice that the Spring components do not use the traditional @Autowired or @Inject annotations for dependency injection in the generated code. This is because we use constructor injection instead of field injection, and Spring Boot doesn't need explicit annotations for constructor injection. Constructor injection is considered better as it enables us to write better unit tests and avoids design issues, whereas field injection is more elegant but easily makes a class monolithic. Constructor injection is a suggested best practice by the Spring team. Constructor injection also makes unit testing components easier.