知识卡片
核心域边界取决于软件的业务目的
同一模型在不同应用中可能承担不同角色。原书举教学例子:通用货币、币种和汇率模型对多数应用只是支撑;货币交易应用则可能需要精细货币模型,并把其专业部分放入核心。运输应用的货物合并、责任转移或路线模型,也可能是各自核心。
核心域要依本项目的差异化业务目的决定,并随迭代修正;一开始看似中心的对象,后来可能只起辅助作用。不能凭模型名称或行业通用标签一次定死。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第15章|Core Domain · 查看原书依据
In a shipping application, the CORE could be the model of how cargoes are consolidated for shipping, how liability is transferred when containers change hands, or how a particular container is routed on various transports to reach its destination.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第117章《Core Domain》(源文件:_epub-src/0321125215_ch15lev1sec1.html;单元02)
- 结论依据:原文以货币交易与运输应用举例说明核心的相对性,并指出同一项目中核心识别也会随认识迭代变化。
- 原始内容:The CORE DOMAIN you choose depends on your point of view. For example, many applications need a generic model of money that could represent various currencies and their exchange rates and conversions. On the other hand, an application to support currency trading might need a more elaborate model of money, which would be considered part of the CORE. Even in such a case, there may be a part of the money model that is very generic. As insight into the domain deepens with experience, the distillation process can continue by separating the generic money concepts and retaining only the specialized aspects of the model in the CORE DOMAIN. In a shipping application, the CORE could be the model of how cargoes are consolidated for shipping, how liability is transferred when containers change hands, or how a particular container is routed on various transports to reach its destination. [...] One application's CORE DOMAIN is another application's generic supporting component. Still, throughout one project, and usually throughout one company, a consistent CORE can be defined. Like every other part of the design, the identification of the CORE DOMAIN should evolve through iterations. The importance of a particular set of relationships might not be apparent at first. The objects that seem obviously central at first may turn out to have supporting roles.
- 转录说明:`[...]` 标明航运例子后的投资银行例子省略;原 EPUB 强调标签边界造成的术语前空格已规范转录。