Guice 与 Spring 启动

Guice vs Spring Boot

有人对我说 Guice 是 restful 微服务的更好选择。

我说...

Spring 引导优惠:

- Core Spring Support - DI + AOP 
- Auto-Configuration: Web, Rest, Data, etc
- Activation Profiles: activate bits of code based on profiles 
- Simplified Web Development: code driven, no xml, no web.xml etc
- Web Testing Support: successful testing is easy testing
- Security Support: out of the box that can be customized
- JMS: out of the box support and can be excluded if not needed
- Actuator: health, trace, beans, info + much more etc 
- Executable and deployable WARs
- Natural fit for restful micro-services
- Fast loading
- extensible, native cloud support and much more

在真实的 Web 应用程序中,这些是开发期间和部署到生产后所需的特性。

Guice-rs 抱怨旧版本 Spring 加载速度慢和程序员错误问题等等。

根据我的阅读,Guice 是为超大型应用程序创建的,这些应用程序有许多开发人员在处理它们,在这种情况下,使用 Spring 之类的东西可能需要更长的加载时间。 Guice 是一个 DI 框架,可让您对如何快速加载应用程序代码进行细粒度控制。

现在我还没有用过Guice,也不了解Guice,有没有Guice阵营的大神指导一下if/how Guice能不能提供以上功能

非常感谢!

Spring 上下文是您之前提到的提供 "Core Spring Support - DI + AOP" 的软件包。该列表中的其他功能由其他 spring 软件包提供。 Spring 引导将它们全部打包到一个带有自动配置的包中。

TL;DR spring-context 与 guice 类似,guice 本身不涵盖列表中的其他项目。