知识卡片

普通读书笔记卡 · 1841.h.1.a.1.a.3.f.1.d

复用也带来共同变化

理解等级:高级

共享实现减少重复,却把使用者绑到共同变化上。领域语义不同的同名实体,局部复制有时比共享类更能保持独立。有效复用需要合适抽象和低变化率;这不是普遍鼓励复制,而是要求把节省的代码与新增耦合一并计算。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Evolutionary Architecture Topologies · 查看原书依据

      Code reuse can be an asset but also a potential liability. Make sure the coupling points introduced in your code don’t conflict with other goals in the architecture. For example, microservices architectures typically use a service mesh to couple the parts of services together that help unify a particular architectural concern, such as monitoring or logging.

    参考来源

    - 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第05章《Evolutionary Architecture Topologies》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch05.html;段落定位:Code reuse can be an asset but also a potential liability) - 结论依据:原文对“复用也带来共同变化”的定义或案例,支撑“共享实现减少重复,却把使用者绑到共同变化上”的归纳。据其上下文,领域语义不同的同名实体,局部复制有时比共享类更能保持独立。 - 原始内容:Code reuse can be an asset but also a potential liability. Make sure the coupling points introduced in your code don’t conflict with other goals in the architecture. For example, microservices architectures typically use a service mesh to couple the parts of services together that help unify a particular architectural concern, such as monitoring or logging.