← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1971.o.1.b.1.a.2.a.1.e.3

通用子域表达领域而内聚机制解决计算

理解等级:高级

[[内聚机制将求解细节从领域表达中分离]]与通用子域都能为核心领域减负,但职责不同:

部分 主要职责
通用子域 用表达性模型描述团队如何理解某个较不核心的领域方面
内聚机制 解决表达性模型提出的棘手计算问题,本身不代表领域

初期边界可能不纯。持续重构时,一段代码可能提纯为机制,也可能发现隐藏的领域概念而成为通用子域;不要仅凭“可复用”给它定性。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第15章|Cohesive Mechanisms · 查看原书依据

      Both GENERIC SUBDOMAINS and COHESIVE MECHANISMS are motivated by the same desire to unburden the CORE DOMAIN. The difference is the nature of the responsibility taken on. A GENERIC SUBDOMAIN is based on an expressive model that represents some aspect of how the team views the domain. In this it is no different than the CORE DOMAIN, just less central, less important, less specialized. A COHESIVE MECHANISM does not represent the domain; it solves some sticky computational problem posed by the expressive models. A model proposes; a COHESIVE MECHANISM disposes. In practice, unless you recognize a formalized, published computation, this distinction is usually not pure, at least not at first. In successive refactoring it could either be distilled into a purer mechanism or be transformed into a GENERIC SUBDOMAIN with some previously unrecognized model concepts that would make the mechanism simple.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第122章《Cohesive Mechanisms》(源文件:_epub-src/0321125215_ch15lev1sec6.html;单元02) - 结论依据:原文直接比较两者的责任,并指出后续重构可向更纯机制或通用子域演变。 - 原始内容:Both GENERIC SUBDOMAINS and COHESIVE MECHANISMS are motivated by the same desire to unburden the CORE DOMAIN. The difference is the nature of the responsibility taken on. A GENERIC SUBDOMAIN is based on an expressive model that represents some aspect of how the team views the domain. In this it is no different than the CORE DOMAIN, just less central, less important, less specialized. A COHESIVE MECHANISM does not represent the domain; it solves some sticky computational problem posed by the expressive models. A model proposes; a COHESIVE MECHANISM disposes. In practice, unless you recognize a formalized, published computation, this distinction is usually not pure, at least not at first. In successive refactoring it could either be distilled into a purer mechanism or be transformed into a GENERIC SUBDOMAIN with some previously unrecognized model concepts that would make the mechanism simple. - 转录说明:原 EPUB 强调标签边界造成的术语前空格已规范转录。