← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1971.o.1.b.4.d.1.c.4.a.3.a.6.a

关系映射应保持命名与关联透明

理解等级:中级

对象存储场景中,尽量让表行对应对象或聚合内从属部分、外键对应实体引用,并使对象与关系表的名称及关联一致。统一语言可连接两边的概念;映射工具的能力不能替代可读性。数据库迁移不便会拖慢对象重构,但若两边长期不同步,关系含义更难辨认。原书承认性能等因素可能要求偏离,重点是偏离须明确且可解释。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第47章《原书第06章|Designing Objects for Relational Databases》(源文件:_epub-src/0321125215_ch06lev1sec4.html) - 结论依据:原文给出行与对象、外键与实体引用的直观对应,并要求两种表示的名称和关联严格对应;也说明迁移成本与性能例外。 - 原始内容:A table row should contain an object, perhaps along with subsidiaries in an AGGREGATE . A foreign key in the table should translate to a reference to another ENTITY object. ... The names and associations of elements in the objects should correspond meticulously to those of the relational tables.