standard config injection
`main`
| \
first | \import
reads | \other
outer | \modules/pkgs
config | \
and | other modules/pkgs
inject | \
| \
| \ (now global config and infrastructure are ready)
| \
v v
a module/pkg that provides global config and infrastructure
主程序main
启动时从外部读取配置,然后注入到a module/pkg that provides global config and infrastructure
这样主程序在进入业务逻辑之前就完成了 全局配置 和 依赖的基础设施 的初始化
其他modules/pkgs
直接使用global config and infrastructure即可
网友评论