知识卡片

普通读书笔记卡 · 1971.o.3.d.1.b.1.b.1

份额饼显化整体分配概念

理解等级:高级

单个 Share 只记录一位出借人的份额;按比例分配本金、求总额等规则作用在一组份额组成的整体上。若 Loan 不断逐项操纵被动的 Share,说明模型缺了这个整体概念。

原书图10.18–10.19引入 Share Pie,让 Loan 持有它并委托分配计算。初版把 Pie 视为 Loan 聚合内有局部身份的实体,规则得以集中,但仍与 Loan 紧耦合,运算尚未充分通用;后续将其改为值对象。这里的身份变化是重构中的模型推演,不能把两阶段混写成同一设计。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第10章|Angles of Attack · 查看原书依据

      There are enough pointers now to start probing for that new model. The Share objects are passive in this implementation, and they are being manipulated in complex, low-level ways. This is because most of the rules and calculations about shares don't apply to single shares, but to groups of them. There is a missing concept: shares are related to each other as parts making up a whole.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第82章《Angles of Attack》(源文件:_epub-src/0321125215_ch10lev1sec9.html;单元02) - 结论依据:原文指出规则作用在份额组而非单份额,图10.18–10.19先引入有局部身份的 Share Pie,再在后文重新审视其实体地位。 - 原始内容:There are enough pointers now to start probing for that new model. The Share objects are passive in this implementation, and they are being manipulated in complex, low-level ways. This is because most of the rules and calculations about shares don't apply to single shares, but to groups of them. There is a missing concept: shares are related to each other as parts making up a whole.