This code creates a Guice module.
该代码创建了一个Guice模块。
Guice: Download the Guice 2 beta release.
Guice:下载Guice2beta发行版。
Guice is a dependency injection (DI) framework.
Guice是一个依赖项注入(DI)框架。
I hope you'll consider adding Guice to your toolkit.
我希望您会考虑将Guice添加到工具包中。
Guice calls this method immediately after it constructs my hero.
Guice会在构造好hero之后立即调用此方法。
Developers have contributed Spring, Seam and Guice service adapters.
开发人员已经编写了Spring、Seam、Guice服务适配器等。
You will not have to create or edit a lot of XML files to use Guice.
要使用Guice,不需要创建或编辑大量XML文件。
By default, Guice creates a new instance of each dependency you ask for.
默认情况下,Guice为每个请求的依赖项创建一个新实例。
This means it won't interfere with applications' use of Spring, Guice, etc.
这就意味着它不会影响应用使用Spring、Guice等。
Write your business logic with session beans, Spring, Guice, or Pojo services.
用会话Bean、Spring、Guice或Pojo服务写业务逻辑。
This is the first way of getting Guice to construct your objects: asking explicitly.
这是Guice构造对象的第一种方式:显式询问。
Guice automatically injects the provider method in Listing 15 with the correct arguments.
在清单15中,Guice自动使用正确的参数注入provider方法。
Dhanji: Sure, the primary principles are conciseness and type-safety, just like Guice.
Dhanji:当然可以。主要的原则就是简洁与类型安全,就像Guice那样。
I think Dependency Inversion is so important that I want to invert the dependencies on Guice!
我认为依赖倒置非常重要,因此打算转换对Guice的依赖。
If you don't ask Guice to create FrogMan, the annotation has no effect on the code's behavior.
如果不要求Guice构建FrogMan,这个注释对代码行为就没有任何影响。
Provider methods are an excellent way to integrate other libraries into your Guice module.
provider方法是将其他库集成到Guice模块中的很好方式。
It turns out that Guice can bind constant values as well as new instances. Check out Listing 21.
Guice可以绑定常量值和新实例。
Like Guice, it makes aggressive use of annotations to keep configuration as part of the code.
它像Guice一样大量使用注释将配置作为代码的一部分。
To keep the work manageable, you can store the Guice Injector somewhere and call it directly.
为了使工作易于管理,可以将Guice Injector存储在某处并直接调用它。
If you are using an IOC model already (Guice, Spring etc.) then migrating is usually a lot easier.
如果你已经使用了IOC模型(Guice, Sprint等等),那么通常迁移会容易得多。
Now that Guice knows that your hero needs a Vehicle, it needs to know which Vehicle to provide.
Guice知道您的hero需要一个Vehicle后,它需要知道提供什么Vehicle。
The binding annotation is necessary here because otherwise, Guice couldn't tell different Strings apart.
这里有必要使用绑定注释,否则Guice将不能区分不同的String。
You rely on Guice to provide your dependencies, even when you're configuring your Guice module itself.
您依靠Guice来提供依赖项,即使是配置Guice模块本身。
The Binder that Guice passes to your module lets you tell Guice how you want your objects constructed.
Guice传递给模块的Binder 用于告诉 Guice您想如何构造对象。
Guice and other DI frameworks serve as flexible "super factories" that you configure to build your objects.
Guice和其他DI框架可作为“超级工厂”,您可以通过配置它们来构建对象。
Familiarity with Guice, or with another dependency injection framework such as Spring, would be useful.
熟悉一下Guice或Spring等其他依赖注入框架会很有用。
They weren't necessary, but were done so you could use Guice to make it easier to write your business logic.
它们并非必需的,但是这样做可以通过Guice使业务逻辑的编写更容易。
With Spring 2.5 nearing release, some people have compared it's performance to Google's Guice framework.
随着Spring2.5发布日期的临近,一些人开始比较它和Google的Guice框架之间的性能差别。
As I write this, the Guice team is working hard on Guice 2.0 and expects to release before the end of 2008.
在写这篇文章时,Guice开发团队正在奋力编写Guice 2.0,希望能在2008年底之前发布。
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互操作性。
应用推荐