← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 4545.g.8.d.4.c

驱动与被驱动方向不同

理解等级:中级

驱动适配器主动调用核心,例如REST和gRPC入口,因此持有核心API。被驱动适配器被核心调用,例如事务日志,因此由核心声明所需端口并接收其实现。调用方向可以向外,源码依赖仍朝内;组装时先准备日志实现,再交给核心,最后把核心交给入口。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Loose Coupling · 查看原书依据

      A common aspect of “driven” adapters is that the core logic acts on them, so the core application has to know about the port. As such, this code lives in the core package. Our Core Application In our original implementation in “Our Super Simple API”, the transaction logger was used by the front end. In

    参考来源

    - 位置:《Cloud Native Go》第08章《Loose Coupling》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch08.xhtml) - 结论依据:驱动适配器主动调用核心,例如REST和gRPC入口,因此持有核心API。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:A common aspect of “driven” adapters is that the core logic acts on them, so the core application has to know about the port. As such, this code lives in the core package. Our Core Application In our original implementation in “Our Super Simple API”, the transaction logger was used by the front end. In