Hence mostly delegation to App Service, doing data massaging and presentation-related logic.Īpplication Service Layer : Application Service level speaking, it represents business use cases. Presentation Layer : Controller responsible to presenting a business function (provided in Application Service Layer). Here is the approach I used in my past projects, which kind of base on Domain Driven design. I think it is hardly any "best approach" but approach that suit your need. Lets say I receive a product id and would like to retrieve and show details of the product.(This is just an example) If I would not want to process the results and just willing to send requests to database and receive the results, do I still need to have a service annotated class in between controller and repository? Lets say I need to call different methods of service annotated class to process the results should I call them all from controller or pass them to service annotated class? (This is just an example) My question is that to what extend can I do processing in a class with controller annotation? Should I do all the processing in service annotated class and keep controller for receiving requests and returning responses ONLY? I would like to know whats the best practice? I know controller is used to receive requests from view and make requests to for views to show results to users. I have couple of questions and would be grateful to have them answered. I am quite confused with usage of and in Spring-MVC.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |