Guice
- 网络叫我怎能不爱你
Guice
Guice
叫我怎能不爱你
2007年10月4日 随笔档案 - 诗特林... ... JSF 开发的开源论坛源代码 Guice, 叫我怎能不爱你? IT 朋友们,曾经的女人这样对男 …
1
According to the Guice best practices guide, constructor injection is the preferred way to ask for your dependencies.
根据Guice的最佳实践指南,构造函数注入是询问依赖项的首选方式。
2
If you don't ask Guice to create FrogMan, the annotation has no effect on the code's behavior.
如果不要求Guice构建FrogMan,这个注释对代码行为就没有任何影响。
3
Note that Guice can be used in OSGi without Sisu; the 3. 0 release provides standard OSGi interoperation out of the box.
需要注意的是,没有Sisu,Guice自身既可用在OSGi中;其3.0版本提供了开箱即用的标准的OSGi互操作性。
4
Unlike Guice, our DI has a concept of scope lifecycle which is very important for a framework like Cayenne.
与Guice不同的是,我们的DI有作用域生命周期的概念,这个概念对Cayenne这样的框架来说非常重要。
5
However, the most direct influences are the contextual state management model of Seam and the type safe dependency injection model of Guice.
但是,最最直接的影响来自于Seam的上下文状态管理模型和Guice的类型安全依赖注入。
6
One effective refactoring strategy is to introduce to the application a dependency injection 16 container like Spring or Google Guice.
有效重构的一个战略,是向程序引入一个依赖注射16容器,例如Spring或者GoogleGuice。
7
Interesting - the tie in to Seam is obvious, but this is the first I've seen of any involvement from the Guice team. . .
非常有趣——其中与Seam有明显的联系,但这是我第一次看到任何与Guice团队有牵连的东西……
8
This means Guice will keep the refinery around, and whenever another instance requires a fuel source, Guice will inject the same refinery.
这意味着Guice会一直保持“提炼厂”可用,只要另一个实例需要燃料源,Guice就会注入相同的“提炼厂”。
9
All three versions of FrogMan exhibit the same behavior: Guice injects the appropriate Vehicle when they're constructed.
三个FrogMan版本都展示了相同的行为:Guice在构建时注入相应的Vehicle。
10
Currently, Jersey can integrate with Spring, Guice, and can support ATOM representation with apache-adbera integration.
目前,Jersey可以集成Spring、Guice,还支持ATOM表示形式与apache-adbera的集成。
11
Guice and EasyMock stand out as two frameworks I have been using that have used the power of generics to implement extraordinary typesafety.
Guice和EasyMock是我用过的比较优秀的两个框架,它们利用泛型实现了突出的类型安全。
12
Guice and other DI frameworks serve as flexible "super factories" that you configure to build your objects.
Guice和其他DI框架可作为“超级工厂”,您可以通过配置它们来构建对象。
13
Developers have contributed Spring, Seam and Guice service adapters.
开发人员已经编写了Spring、Seam、Guice服务适配器等。
14
You rely on Guice to provide your dependencies, even when you're configuring your Guice module itself.
您依靠Guice来提供依赖项,即使是配置Guice模块本身。
15
Based on the return type of Hero, it works out that when you ask for a hero, it should call this method to provide it.
根据Hero的返回类型,在您请求某个hero时,Guice会进行计算,它应该调用provider方法来提供hero。
16
Write your business logic with session beans, Spring, Guice, or Pojo services.
用会话Bean、Spring、Guice或Pojo服务写业务逻辑。
17
Familiarity with Guice, or with another dependency injection framework such as Spring, would be useful.
熟悉一下Guice或Spring等其他依赖注入框架会很有用。
18
To keep the work manageable, you can store the Guice Injector somewhere and call it directly.
为了使工作易于管理,可以将GuiceInjector存储在某处并直接调用它。
19
Let's dive into Guice, starting with the @Inject annotation and modules.
现在让我们从@Inject注释和模块开始深入讨论Guice。
20
Guice automatically injects the provider method in Listing 15 with the correct arguments.
在清单15中,Guice自动使用正确的参数注入provider方法。
21
by Dhanji R. Prasanna is a book that tries to explore the DI idiom in detail, and present techniques in Spring and Guice.
DhanjiR.Prasanna的著作《依赖注入》是一本力图详细探究依赖注入领域,并呈现Spring和Guice技术的著作。
22
Like Guice, it makes aggressive use of annotations to keep configuration as part of the code.
它像Guice一样大量使用注释将配置作为代码的一部分。
23
Guice calls this method immediately after it constructs my hero.
Guice会在构造好hero之后立即调用此方法。
24
Dhanji: Sure, the primary principles are conciseness and type-safety, just like Guice.
Dhanji:当然可以。主要的原则就是简洁与类型安全,就像Guice那样。
25
If you're familiar with Guice, the code above should look familiar.
如果您熟悉Guice,上述代码应该会看起来很眼熟。
26
Provider methods are an excellent way to integrate other libraries into your Guice module.
provider方法是将其他库集成到Guice模块中的很好方式。
27
Guice offers you an option when you select scopes.
在选择作用域时,Guice提供了一个选项。
28
With Spring 2. 5 nearing release, some people have compared it's performance to Google's Guice framework.
随着Spring2.5发布日期的临近,一些人开始比较它和Google的Guice框架之间的性能差别。
29
This is the first way of getting Guice to construct your objects: asking explicitly.
这是Guice构造对象的第一种方式:显式询问。
30
With Guice 2. 0 we even support a DSL to intuitively map servlets and filters to URL paths in web applications.
在Guice2.0中我们支持一个DSL可以在web应用中将servlet和过滤器映射到URL路径。