知识卡片
单向模块依赖利于独立演进
控制器、业务服务和数据访问模块若形成清晰的单向依赖,每层只经公开接口访问下一层,便可分别推理和测试。以后拆服务时,既有模块边界可成为切分线;但不要把技术分层误当成业务边界已正确。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
access object (DAO) patterns. Each controller exposes the RESTful endpoints and will be exposed by the web server hosting the application. The service module is where the business logic lives behind the controller, exposing a clear interface to the controllers. The DAO module is where the data access object lives behind the services, exposing clear interfaces to the services. Module layers are quite common, and
参考来源
- 位置:《Mastering API Architecture》第8章《Redesigning Applications to API-Driven Architectures》之《Decomposing a System into Modules》(源文件:_epub-src/OEBPS/ch08.xhtml)
- 结论依据:原文以会议系统的 controller、service、DAO 为例,强调单向依赖和独立测试,再叙述后续拆分。
- 原始内容:access object (DAO) patterns. Each controller exposes the RESTful endpoints and will be exposed by the web server hosting the application. The service module is where the business logic lives behind the controller, exposing a clear interface to the controllers. The DAO module is where the data access object lives behind the services, exposing clear interfaces to the services. Module layers are quite common, and