Implementing the task manager business logic
In Chapter 2, Adding Persistence, we created the persistence layer for the application. We created entities for users, projects, and tasks following the active record pattern. In this chapter, we’re creating the HTTP API that will be consumed by the frontend of our task manager application. However, before implementing the HTTP endpoints, it’s a good practice to encapsulate the business logic of the application within different service classes. We can expose the operations provided by these services later by implementing the non-blocking JAX-RS annotated classes and methods.
We are going to implement three services: UserService
, TaskService
, and ProjectService
. Let us start by analyzing UserService
since it contains some methods that will be reused by the rest of the services.
UserService
The user service will be used to encapsulate all the required business logic for managing the application’s users. Later...