← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1971.o.1.c.1.b.2.b.2.a

过账规则明确触发和补取

理解等级:高级

过账规则的类关系还不足以确定运行行为,必须规定谁启动处理、谁找出上次处理后新增的输入条目。原书列出三种选择:

  1. 即时触发:输入 Account 插入 Entry 时立刻执行规则。
  2. Account 延迟触发:外部请求 Account 执行规则,由 Account 处理自上次触发以来的 Entry。
  3. Posting Rule 延迟触发:外部请求规则执行,由规则查找输入账户自上次触发以来的 Entry。

系统可混用方式,但每组规则须有明确的启动点和条目识别责任。把这三种方式纳入通用语言,才便于讨论时间耦合与漏处理边界。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第11章|Example Insight into the Nightly Batch · 查看原书依据

      The Posting Rule has established the conceptual dependency between Accounts, but if the pattern stopped there, it could be difficult to follow. One of the trickiest parts of dependency designs is the timing and control of updates. Fowler discusses three options. "Eager firing" is the most obvious, but typically the least practical. Whenever an Entry is inserted into an Account, it immediately triggers the Posting Rules and all updates are made immediately.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第85章《Example Insight into the Nightly Batch》(源文件:_epub-src/0321125215_ch11lev2sec2.html;单元01) - 结论依据:原文分别定义三种 firing mode,并要求每组规则明确启动点与输入条目识别责任。 - 原始内容:The Posting Rule has established the conceptual dependency between Accounts , but if the pattern stopped there, it could be difficult to follow. One of the trickiest parts of dependency designs is the timing and control of updates. Fowler discusses three options. "Eager firing" is the most obvious, but typically the least practical. Whenever an Entry is inserted into an Account , it immediately triggers the Posting Rules and all updates are made immediately.