知识卡片
导入方向可执行
把允许的包依赖关系写成测试,可以在反向依赖出现时立即失败。其价值不是限制语法,而是保存分层或职责隔离背后的长期理由。规则应明确源包、目标包与允许方向,避免只在文档里要求“保持解耦”。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 导入方向可执行
原书出处 · 1 处
- Automating Architectural Governance · 查看原书依据
In Example 4-1, we define the packages in our application and then define the rules about imports. If a developer accidentally writes code that imports into util from persistence, this unit test will fail before the code is committed. We prefer building unit tests to catch architecture violations over using strict development guidelines (with the attendant bureaucratic scolding): it allows developers to focus more on
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第04章《Automating Architectural Governance》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch04.html;段落定位:If a developer accidentally writes code that imports)
- 结论依据:原文对“导入方向可执行”的定义或案例,支撑“把允许的包依赖关系写成测试,可以在反向依赖出现时立即失败”的归纳。据其上下文,其价值不是限制语法,而是保存分层或职责隔离背后的长期理由。
- 原始内容:In Example 4-1, we define the packages in our application and then define the rules about imports. If a developer accidentally writes code that imports into util from persistence, this unit test will fail before the code is committed. We prefer building unit tests to catch architecture violations over using strict development guidelines (with the attendant bureaucratic scolding): it allows developers to focus more on