What should 'Service Layer' do? (MVC; layered architecture)
- I'm working on an MVC project, and from the controllers I'm using different services. As you can see in the screenshot, this services are Operation, Admin and Account, and they all are in the same layer. Models, controllers and views are inside the Web layer/project.
- What I've learned so far while reading here and there, is that service layer contains CRUD business operations, using repositories (Repository Pattern and Unit of Work in my case). And the business rules are contained inside those operations (though I may be wrong on this new learning).
- On some other place I've read that business rules belong to the 'Business Layer', and the BL may or may not be implicitly contained in the 'Service Layer'. Moreover, may the BL be a DLL (for example) outside of the SL.
Hence, my questions:
- What is your experience regarding the implementation of Service Layer? How do you implement it (the best)?
- What do you think are best practices regarding this topic?
- Is it the same 'Business rules' than 'Business logic'?
- My main problem with most of the information I've found is the lack of actual and simple real work examples (like this line I read in some answer at SO: "For example, a book library lending a Book to a Client (with corresponding Inventory changes) might do so from a domain service."
This is just one of the (not completely helpful) readings I made: https://stackoverflow.com/questions/2268699/domain-driven-design-domain-service-application-service
Probably there's some (or a lot) on non-sense in this post. Keep in mind I'm barely starting, and there's a lot of information out there, even contradictory. At least that seems to be the landscape for me in a somewhat shallow research in the internet.
- What I've learned so far while reading here and there, is that service layer contains CRUD business operations, using repositories (Repository Pattern and Unit of Work in my case). And the business rules are contained inside those operations (though I may be wrong on this new learning).
- On some other place I've read that business rules belong to the 'Business Layer', and the BL may or may not be implicitly contained in the 'Service Layer'. Moreover, may the BL be a DLL (for example) outside of the SL.
Hence, my questions:
- What is your experience regarding the implementation of Service Layer? How do you implement it (the best)?
- What do you think are best practices regarding this topic?
- Is it the same 'Business rules' than 'Business logic'?
- My main problem with most of the information I've found is the lack of actual and simple real work examples (like this line I read in some answer at SO: "For example, a book library lending a Book to a Client (with corresponding Inventory changes) might do so from a domain service."
This is just one of the (not completely helpful) readings I made: https://stackoverflow.com/questions/2268699/domain-driven-design-domain-service-application-service
Probably there's some (or a lot) on non-sense in this post. Keep in mind I'm barely starting, and there's a lot of information out there, even contradictory. At least that seems to be the landscape for me in a somewhat shallow research in the internet.

Stack Overflow
Can someone explain the difference between domain and application services by providing some examples? And, if a service is a domain service, would I put the actual implementation of this service w...
