知识卡片
共用数据库须有意识划分模型
数据库若来自旧系统、外部系统,或还服务于不会实例化领域对象的软件,就可能同时存在不同模型。此时可选择适配外部模型,或清楚划分独立模型;为了多方使用而让数据库结构与对象模型分离也可能合理。关键是明确作出选择并维护边界,避免团队只因数据库未随对象重构而无意形成“两套模型”。性能限制也是需要明示的例外。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第06章|Designing Objects for Relational Databases · 查看原书依据
If the separation is chosen consciously, it can result in a clean database schemanot an awkward one full of compromises conforming to last year's object model.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第47章《原书第06章|Designing Objects for Relational Databases》(源文件:_epub-src/0321125215_ch06lev1sec4.html)
- 结论依据:原文列出旧/外部系统和数据库多用途的情形,指出可同化或分离模型,并提醒无意分离与有意识分离的结果不同。
- 原始内容:The database may also be used by other software that will not instantiate objects. ... If the separation is chosen consciously, it can result in a clean database schemanot an awkward one full of compromises conforming to last year's object model.