← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2313.e.5.i.2

模块直连会暴露编译时依赖

理解等级:中级

模块之间直接调用最简单:一个模块实例化另一模块的类并调用方法。但同库代码容易随意跨界访问;独立构件则必须显式引入类引用或共享接口,形成编译时依赖。接口只改变依赖组织,不会让过多通信自动消失;模块间调用密集时,先检查领域边界是否划错。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Fundamentals of Software Architecture》原书第11章《The Modular Monolith Architecture Style》(阅读计划第14项;源文件:`OEBPS/ch11.html`) - 结论依据:原文说明点对点调用、独立构件的编译时依赖,以及过量通信的风险。 - 原始内容:A module that communicates with other modules won’t compile unless it has the class references, which means the developer has to form a compile-time dependency between those modules.