- Published on
In the previous chapter, we set up a controller and made 5 endpoints to do CRUD operations. The API works very fine, but if you consider the maintainability and extendability of the code base, writing all business logic in controllers is a bad practice because it violates the responsibility of a controller and the controller has too many other responsibilities. This is why we will introduce a service layer to this project to remove all business logic from the controller and put them into the service layer.