V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
ke1e
V2EX  ›  Go 编程语言

Go 语言中 Web 项目的依赖管理的最佳实践是什么?不使用 DI 的情况下

  •  
  •   ke1e · 27 天前 · 678 次点击
    Go Web 项目应该还是 MVC 架构吧;

    那么 Service 还是用单例模式嘛?

    是在 Route 初始化的时,构造 Handler 将 Service 初始化传进去嘛,如果需要用到别的 Service 呐?

    那么如果异步任务模块也用到了这些 Service 呐?

    有没有大佬解答下
    1 条回复
    saibotan
        1
    saibotan  
       23 天前
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3378 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 04:22 · PVG 12:22 · LAX 21:22 · JFK 00:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.