知识卡片
仓储设计需顺应既有框架
引入仓储前,应核对项目既有框架是否已提供同等的持久对象入口,及其约束是否允许仓储语义。原书用当时 J2EE 的 EJB Home 举例:强行把框架入口包装成仓储,可能增加问题。优先保留模型驱动设计的原则,再选择与框架相容的具体形式;有选择权时,选支持所需设计风格的框架。该技术例子有历史语境。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第06章|Repositories · 查看原书依据
In general, don't fight your frameworks. Seek ways to keep the fundamentals of domain-driven design and let go of the specifics when the framework is antagonistic. Look for affinities between the concepts of domain-driven design and the concepts in the framework.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第46章《原书第06章|Repositories》(源文件:_epub-src/0321125215_ch06lev1sec3.html;小节 Working Within Your Frameworks)
- 结论依据:原文要求在实现仓储前考虑已有基础设施和框架,指出 EJB Home 可能并不适合包装为仓储,并主张保留设计原则、寻找概念亲和性。
- 原始内容:In general, don't fight your frameworks. Seek ways to keep the fundamentals of domain-driven design and let go of the specifics when the framework is antagonistic. Look for affinities between the concepts of domain-driven design and the concepts in the framework.