Answer the question
In order to leave comments, you need to log in
What is the service layer in a Spring application doing?
I know that the Spring application is divided into different layers: Config (where our configs are), DAO (for working with the database), Model (our data, Pojo classes), Controllers (controllers) and service, which should contain business logic. In one project I saw this picture: DAO has a UserDAO class that works with the database and Service has a UserService class that has a UserDAO field and it exactly copies all UserDAO methods and simply writes UserDAO.getUsers() inside; The data then goes to the controller. Why is service needed in such applications if it simply calls methods from DAO?
Answer the question
In order to leave comments, you need to log in
There are two main reasons for the appearance of a "transparent service layer" in applications:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question