知识卡片
聚合划定事务边界
聚合中的全部变化应在一个原子事务内提交,避免部分更新;一个事务只提交一个聚合实例。需要同时满足不变量的多个实体应归入同一聚合。若业务操作必须同时修改多个聚合才能正确,就应重新检查边界,不能用领域服务绕开这一约束。
相关:[[聚合命令守住不变量]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 应对复杂业务逻辑 · 查看原书依据
Since an aggregate’s state can only be modified by its own business logic, the aggregate also acts as a transactional boundary. All changes to the aggregate’s state should be committed transactionally as one atomic operation. If an aggregate’s state is modified, either all the changes are committed or none of them is. Furthermore, no system
参考来源
- 位置:《Learning Domain-Driven Design》第6章《应对复杂业务逻辑》(来源项目:book-sources;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch06.html)
- 结论依据:原文围绕本卡所述机制给出定义、适用条件及相关取舍,以下摘录为直接依据。
- 原始内容:Since an aggregate’s state can only be modified by its own business logic, the aggregate also acts as a transactional boundary. All changes to the aggregate’s state should be committed transactionally as one atomic operation. If an aggregate’s state is modified, either all the changes are committed or none of them is. Furthermore, no system