vefmediagroup.blogg.se

Java annotations best practices
Java annotations best practices












java annotations best practices

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.

java annotations best practices

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?

java annotations best practices

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.














Java annotations best practices