开发者

ASP.NET MVC: What's the difference in concept between Service and Repository

The question I'm asking is kind of subjective. I've seen twice, while exercising with real projects such as StoreFront, both Repository and Services. Sometimes they can just be folders or projects 开发者_开发百科attached to the solution. But they contain classes and interfaces.

So, I'd like to know what goes to the repository and what goes to the services. So far, I was familiar with repositories (we put methods and properties in the repository to reduce the complexity in the controller). How about the services?

So, ASP.NET MVC: What's the difference in concept between Service and Repository? (Maybe none)

My question is Kind of subjective, but I'd like to make sure that I'm not missing anything.

Thanks for helping


Generally, the repository simply provides an interface to data. There is no application logic there. Services provide interfaces to application logic. Services often use repositories.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜