← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1973.ah.1.g.1

先稳聚合再上事件

理解等级:高级

遗留事务脚本或活动记录不宜直接跃迁到事件溯源。先引入不可变值对象、收拢相关逻辑,按业务强一致需求确定状态型聚合;确认边界后再转事件模型。这样把学习边界与改变持久化分开,避免发现错误事务范围时还要同时处理已有事件历史。改造可以逐步发生,不需原子式重写。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 现实中的领域驱动设计 · 查看原书依据

      First, small incremental steps are safer than a big rewrite. Therefore, don’t refactor a transaction script or active record straight to an event-sourced domain model. Instead, take the intermediate step of designing state-based aggregates. Invest the effort in finding effective aggregate boundaries. Ensure that all related business logic resides within those boundaries. Going from state-based

    参考来源

    - 位置:《Learning Domain-Driven Design》第13章《现实中的领域驱动设计》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch13.html) - 结论依据:原文明确建议先状态聚合再事件聚合,并按一致性业务需求逐步重构。 - 原始内容:First, small incremental steps are safer than a big rewrite. Therefore, don’t refactor a transaction script or active record straight to an event-sourced domain model. Instead, take the intermediate step of designing state-based aggregates. Invest the effort in finding effective aggregate boundaries. Ensure that all related business logic resides within those boundaries. Going from state-based