知识卡片
领域专家可否决套用交易模型
分析模式提供候选结构,领域专家应校验其业务含义。原书的虚构建模对话里,开发者一度把利息计提和付款绑成 Transaction;同伴指出 Transaction 原义是不同账户间转移,不是同一账户里两条相抵条目。专家进一步说明计提与付款是独立入账,未必一一对应,却希望在 Account 中看到历史和余额。
因此保留 Account/Entry,移除误用的 Transaction,并用 Accrual、Payment 区分两类重要条目。拒绝一个模式构件不等于放弃分析模式;应保留真正契合业务的部分。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第11章|Example Earning Interest with Accounts · 查看原书依据
Expert: Why do we need to tie together the accrual to the payment? They are separate postings in the accounting system. The balance on the Account is the main thing. Along with the individual Entries, we really have what we need.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第84章《Example Earning Interest with Accounts》(源文件:_epub-src/0321125215_ch11lev2sec1.html;单元02)
- 结论依据:原文对话中专家明确反对把计提与付款强绑,强调独立过账及账户余额;图11.4–11.6显示 Transaction 被划去而 Account 留下。
- 原始内容:Expert: Why do we need to tie together the accrual to the payment? They are separate postings in the accounting system. The balance on the Account is the main thing. Along with the individual Entries, we really have what we need.