知识卡片
活动记录封装映射
活动记录是携带持久化能力的数据对象,用来封装复杂对象结构到数据库的映射,并可包含简单校验。业务操作仍由事务脚本组织,只是改为操作这些对象;整个操作依然需要原子性。它解决的是数据映射复杂,而非复杂业务规则;对象通常公开状态访问,不能据此等同于封装行为的领域模型。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 实现简单业务逻辑 · 查看原书依据
Consequently, this pattern uses dedicated objects, known as active records, to represent complicated data structures. Apart from the data structure, these objects also implement data access methods for creating, reading, updating, and deleting records—the so-called CRUD operations. As a result, the active record objects are coupled to an object-relational mapping (ORM) or some other data
参考来源
- 位置:《Learning Domain-Driven Design》第5章《实现简单业务逻辑》(来源项目:book-sources;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch05.html)
- 结论依据:原文对该概念的定义、应用条件及相邻概念的比较支撑本卡解释。
- 原始内容:Consequently, this pattern uses dedicated objects, known as active records, to represent complicated data structures. Apart from the data structure, these objects also implement data access methods for creating, reading, updating, and deleting records—the so-called CRUD operations. As a result, the active record objects are coupled to an object-relational mapping (ORM) or some other data