知识卡片
模块化是相关代码的逻辑分组
模块化把相关代码归为一个逻辑单元;它可由类、函数、包或命名空间表达,并不必然要求独立部署。原书以 Java 的客户包收纳客户相关行为为例,说明边界由相关性决定,而非仅由目录名决定。
包装方式会影响可见范围和复用。如果多个包紧密依赖,单独复用其中一个就会困难。架构中的“组件”通常是建立在模块之上的构件,但逻辑分组与物理拆分仍要分别判断。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Modularity · 查看原书依据
In this book’s discussions about architecture, we use modularity as a general term to denote a related grouping of code: classes, functions, or any other grouping. This doesn’t imply a physical separation, merely a logical one.
参考来源
- 位置:《Fundamentals of Software Architecture》第05章《Modularity》(源文件:`OEBPS/ch03.html`,Defining Modularity、From Modules to Components)
- 结论依据:原文把模块化定义为相关代码的逻辑分组,明确不隐含物理分离;Java 客户包与紧耦合复用困难均为原书例子。
- 原始内容:In this book’s discussions about architecture, we use modularity as a general term to denote a related grouping of code: classes, functions, or any other grouping. This doesn’t imply a physical separation, merely a logical one.