This is my current project design
Controller-> service -> Repository
I am trying to understand :
-
What layer(Name) i can create between Controller-> service if in
case i need to have layer which can be composition of services. -
What layer I can create between service -> Repository .
-
If i am having Repository Layer can i also keep DAO layer.
Many Thanks.
>Solution :
The service layer is the thing you need to use when manipulating with data retrieved from db. So you do not need to create extra-layers between controller-service-repository. The main idea is to use repository for db operations, service for data manipulation + additional logic, controller for creating api. Or there is an approach with additional api layer where you create api interfaces then controller implements them and then service(logic) and repository(sql)