知识卡片
数据复杂再引活动记录
事务脚本和活动记录都以过程式逻辑执行业务。差异在于活动记录用对象封装数据结构与存储映射。当脚本直接访问复杂存储模型变得困难,可先把这部分数据操作封装为活动记录,无需同时把业务过程改写成领域模型。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 演进设计决策 · 查看原书依据
At their core, both the transaction script and active record patterns are based on the same principle: the business logic is implemented as a procedural script. The difference between them is how the data structures are modeled: the active record pattern introduces the data structures to encapsulate the complexity of mapping them to the storage
参考来源
- 位置:《Learning Domain-Driven Design》第11章《演进设计决策》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch11.html)
- 结论依据:原文明确两模式共享过程式原则,迁移触发点是数据结构和映射复杂度。
- 原始内容:At their core, both the transaction script and active record patterns are based on the same principle: the business logic is implemented as a procedural script. The difference between them is how the data structures are modeled: the active record pattern introduces the data structures to encapsulate the complexity of mapping them to the storage