专注于面向对象、领域驱动设计,及软件架构方面的学习
要学会站在巨人的肩膀上让自己成长。QQ:94388050
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
::
39 随笔 :: 0 文章 :: 355 评论 :: 0 引用
DDD Aggregate Definition
A cluster of associated objects that are treated as a unit for the purpose of data changes. External references are restricted to one member of the Aggregate, designated as the root. A set of consistency rules applies within the Aggregate's boundaries. Problem: It is difficult to guarantee the consistency of changes to objects in a model with complex associations. Invariants need to be maintained that apply to closely related groups of objects, not just discrete objects. Yet cautious locking schemes cause multiple users to interfere pointlessly with each other and make a system unusable. [DDD, p. 126] Solution: Cluster the
Entities
and
Value Objects
into Aggregates and define boundaries around each. Choose one Entity to be the root of each Aggregate, and control all access to the objects inside the boundary through the root. Allow external objects to hold references to root only. Transient references to the internal members can be passed out for use within a single operation only. Because the root controls access, it cannot be blindsided by changes to the internals. This arrangemens makes it practical to enforce all invariants for objects in the Aggregate and for the Aggregate as a whole in any state change.
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted on 2011-12-03 14:21
netfocus
阅读(153)
评论(1)
编辑
收藏
评论
2287088
#1楼
2012-01-05 15:17
安度
我觉得,楼主还是说中文吧...
回复
引用
查看
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
电子商务领域应用社交分享按钮需慎重,不恰当的使用会导致产品销量锐减
·
Box发布新版Android应用,在今后30天内使用升级版应用的用户将获得50G的免费储存空间
·
平台分流风险:你需要思考的几个问题
·
10大电子商务创新案例集合:每月订购、反向定价、游戏化、社交购物
·
3D打印技术“复活”恐龙
»
更多新闻...
最新知识库文章
:
·
编程的艺术:漂亮的代码和漂亮的软件
·
GIT分支管理是一门艺术
·
编程:是一门艺术
·
编程是一门艺术吗?
·
对Java初学者的忠告
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
搜索
随笔档案
(39)
2012年2月 (14)
2012年1月 (1)
2011年12月 (2)
2011年11月 (2)
2011年10月 (2)
2011年9月 (3)
2011年7月 (1)
2011年6月 (1)
2011年4月 (2)
2011年3月 (2)
2011年1月 (1)
2010年12月 (2)
2010年8月 (1)
2010年4月 (1)
2010年3月 (2)
2010年1月 (2)
最新评论