知识卡片
行项保存成交价降低争用
针对[[共享部件加锁造成循环等待]],把采购时适用的价格复制到采购单行项,使整单上限校验依赖行项内的价格,不再为每次编辑锁住跨订单共享的部件。部件当前价格变化不必立刻改写所有既有采购单;已履行或归档的单据应保留当时价格。需要追踪旧价格时可另行排队处理。这样收紧采购单与行项的一致性边界,同时放松采购单与部件的即时依赖。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第06章|Aggregates · 查看原书依据
Parts are used in many POs (high contention). There are fewer changes to parts than there are to POs. Changes to part prices do not necessarily propagate to existing POs.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第44章《原书第06章|Aggregates》(源文件:_epub-src/0321125215_ch06lev1sec1.html;图6.11)
- 结论依据:原文说明共享部件高争用且价格变更未必传播到旧采购单,图6.11把价格移入行项;正文给出旧价队列处理的可选方案。
- 原始内容:Parts are used in many POs (high contention). There are fewer changes to parts than there are to POs. Changes to part prices do not necessarily propagate to existing POs. ... Figure 6.11. Price is copied into Line Item . A GGREGATE invariant can now be enforced. ... By making the dependency of line items on parts looser, we avoid contention and reflect the realities of the business better.