增加个接口/IObjectTrackingManager 修改下事务引用#1
Open
liamyue wants to merge 2 commits intoyuezhongxin:masterfrom
liamyue:master
Open
增加个接口/IObjectTrackingManager 修改下事务引用#1liamyue wants to merge 2 commits intoyuezhongxin:masterfrom liamyue:master
liamyue wants to merge 2 commits intoyuezhongxin:masterfrom
liamyue:master
Conversation
Owner
|
@liamyue 感谢你的代码提交,不过我觉得是有些问题:
你的这种方式很像我之前提到的,只不过实现形式不太一样,并且Repository增加了ExecuteSqlCommand
这种方式博文最后进行比较了,我的想法都在里面。 |
Author
|
代码提交的不是很完整,嗯 这篇文章看了,就像汤雪华回帖的内容说的 UnitOfWork的实现没有变 只是将指责分离成两个接口 一个是对外管理commit 事务 一个是对内 Repository对对象进行管理,IUnitOfWork对对象的持久化,是被动的通过仓储(IObjectTrackingManager)完成的 其实我就是应用评论对代码做了调整:) 我是新手,对DDD还不了解 只是凭感觉 |
Owner
|
@liamyue 嗯,非常感谢你的代码提交。 但我现在设计的原则是,UnitOfWork只维护领域对象的状态(比如增删改及事务),Repository只做查询(并且接口返回IQueryable),这种方式我后来在实际项目中一直应用,还不错,所以,你的设计方式我就不采纳了哈,关于DDD可以一起交流学习。:) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.