知识卡片

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

结构规则应以概念一致性和实际收益定严宽

理解等级:高级

大型结构可从宽松的系统隐喻到严格的可插拔组件框架。同一模式内也能选择约束强度:例如责任层只规定概念和依赖,或进一步统一层间通信。

更严的规则可能提升一致性、可读性和组件衔接;也可能剥夺必要灵活性,尤其跨限界上下文或技术异构时。判断标准是规则是否贴合领域并让开发更容易,而非为了建立框架而统一实现细节。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第133章《How Restrictive Should a Structure Be?》(源文件:_epub-src/0321125215_ch16lev1sec6.html;单元01) - 结论依据:原文比较大型结构的约束跨度、规则一致性的收益、异构上下文中的代价,并要求每条规则有助开发。 - 原始内容:We could figure this out on a case-by-case basis, or we could decide on a consistent pattern for everyone to follow in interactions of objects of particular layers. A more restrictive structure increases uniformity, making the design easier to interpret. If the structure fits, the rules are likely to push developers toward good designs. Disparate pieces are likely to fit together better. On the other hand, the restrictions may take away flexibility that developers need. Very particular communication paths might be impractical to apply across BOUNDED CONTEXTS, especially in different implementation technologies, in a heterogeneous system. [...] The most important contribution of the large-scale structure is conceptual coherence, and giving insight into the domain. Each structural rule should make development easier. - 转录说明:`[...]` 标明异构系统例句与结论之间省去的框架化警告句;标签边界的多余空格按可读正文规范转录。