Reputation: 9342
I have a solution composed of several layers: controller > service > business > repository
I'm learning MVC so I try as much as possible to follow best practices. I think the controller must be as light as possible. Let's say we have an Edit action in my controller receiving a view model posted by the corresponding view. This view model is a substract of data contained in a model object.
What I have to achieve with this view model:
My question: where do I have to code all these things?
In my point of view, the points 1, 2, 3 must be done in a business layer and the points 4 and 5 in the controller layer.
Can you confirm?
Thanks.
Upvotes: 4
Views: 117
Reputation: 35136
Service class is what I refer to as a Business layer. If you mean a Web Service by that then the class representing the web service should internally be dispatching calls to your actual Business class otherwise you don't need an intermediate Service class between your Business and Controller.
Upvotes: 2