我最近在大学课程中学习过Guice,并且看过Google I / O视频 。 在视频中,他们声称在每个Google项目中使用它,包括Wave等。我在想 - Guice真的无处不在吗? 它对Java中的程序员来说真的是必须知道必须使用的吗? 我应该经常在工厂使用吗?
谢谢
I've recently studied about Guice in a University course, and have seen the Google I/O video about it. In the video, they claim to use it in every Google project, including Wave, etc. I was wondering - is Guice really that ubiquitous? Is it really a must-know-must-use for programmers in Java? Should I always use it over a factory?
Thanks
最满意答案
Guice真的无处不在吗? 它对Java中的程序员来说真的是必须知道必须使用的吗?
谷歌之外 - 不,不是真的。 我不是说它不是一个好产品,它现在似乎没有被广泛使用。 还有其他更成熟的框架提供依赖注入,如Spring或EJB。 主要区别在于Guice 只进行依赖注入。
我应该经常在工厂使用吗?
当然不是。 依赖注入是一种有用的模式,但与所有有用的工具一样,使用它有正确和错误的时间。
is Guice really that ubiquitous? Is it really a must-know-must-use for programmers in Java?
Outside of Google - no, not really. I'm not saying it's not a good product, it just doesn't seem very widely used right now. There are other, more established frameworks out there that provide dependency injection, like Spring or EJB. The main difference is that Guice only does dependency injection.
Should I always use it over a factory?
Of course not. Dependency injection is a useful pattern, but as with all useful tools, there's a right and a wrong time to use it.
更多推荐
发布评论