Responsibilities of Service and Repository layers

笑着哭i 提交于 2019-12-03 07:17:28

Your separation of concerns sounds pretty good to me. We follow the same pattern, but tend to add one more layer right about the repository layer. We call it the domain layer and perform all our business logic in there. Our service layer is just a pass through to our domain in case we need to publish any of our services to an ESB in the future.

The biggest benefit of what you are doing is not cluttering all the business and DB logic in the controller which a lot of people tend to do. You always want your controllers to be as light as possible if you really want to follow MVC.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!