知识卡片

普通读书笔记卡 · 3333.j.1

模块化与粒度回答不同问题

理解等级:初级

模块化回答“系统如何拆成若干部分”,粒度回答“每一部分应有多大”。拆分本身不保证边界合理:服务太细可能增加跨服务依赖,使维护与协作更复杂。

原书以分层单体走向微服务说明模块化程度变化,并提醒注意服务或组件的粒度及耦合。是否再拆一个服务,需检查它与其他部分的交互,而非只追求更小的单元。与[[模块化是相关代码的逻辑分组]]相连。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Modularity · 查看原书依据

      Modularity is about breaking systems apart into smaller pieces, such as moving from a monolithic architecture style (like the traditional n-tiered layered architecture) to a highly distributed architecture style, like microservices. Granularity, on the other hand, is about the size of those pieces—how big a particular part of the system (or service) should be.

    参考来源

    - 位置:《Fundamentals of Software Architecture》第05章《Modularity》(源文件:`OEBPS/ch03.html`,Modularity Versus Granularity) - 结论依据:原文区分 modularity 与 granularity,并指出不当粒度会造成服务、组件耦合及分布式单体等反模式;末句是应用推断。 - 原始内容:Modularity is about breaking systems apart into smaller pieces, such as moving from a monolithic architecture style (like the traditional n-tiered layered architecture) to a highly distributed architecture style, like microservices. Granularity, on the other hand, is about the size of those pieces—how big a particular part of the system (or service) should be.