例如,魔法属性kernel指向内核,它自动被框架注入到类中。
For example, the magic attribute kernel refers to the kernel, which is automatically injected into the class by the framework.
NK:控制反转仅仅是一种思想,各种依赖注入(无论有无框架)都取决你设计的软件是否抱有控制反转的目的。
NK: inversion of control is a mindset, and dependency injection of any kind (with or without a framework) relies on your software being designed with the goals of inversion of control in mind.
正如在本系列的第一篇文章中解释过的,构造函数注入表明框架会提供类在初始化时需要的构造函数参数。
As explained in the first article of this series, constructor injection implies that the framework supplies constructor parameters required by the class upon instantiation.
当我听闻这一消息后,就立即加入了这个项目,开始对核心的依赖注入容器以及AOP框架进行移植。
As soon as I heard about it, I joined the project and we started porting the core Dependency Injection container and AOP framework.
核心特性如依赖注入(DI)容器、AOP以及数据访问框架,都可以非常好地应用在任意的。NET应用程序中。
Core features, such as the Dependency Injection (DI) container, AOP and the data access framework can be used in pretty much any.net application.
虽然在某种意义上依赖注入在技术上并没什么特别的;实际上DI框架所做的就是为对象之间的交互提供一个中枢。
In a sense though dependency injection is not technically particularly interesting; really what DI frameworks do is offer a backbone for interactions between objects.
对于更大型的程序,我更愿意做外部引用或者使用依赖注入框架。
For larger applications, I prefer to wire in that reference externally or use a dependency injection framework.
NK:传统上的依赖注入框架依赖于XML去定义元数据,从而为你的应用程序组成组件。
NK: Dependency injection frameworks have traditionally relied on XML to define the metadata necessary to wire up the components of your application.
比如,负责生产环境技术支持的人不关心开发人员选择注入哪种日志记录框架。
For example, people in the production support role are not concerned with what logging framework the developers choose to inject.
我可不想让依赖注入框架的代码散布在我的应用当中。
I don't want [Dependency Injection] framework code smeared all through my application.
最终的目的是要创建一个轻便快速,易于使用的依赖注入框架。
To that end, I've tried to create the lightest, fastest, most easy to use dependency injection framework.
框架通过两种方式将应用服务与运行中的POJO关联起来:拦截POJO的执行上下文或将服务对象注入POJO中。
The framework "wires" application services to the POJOs by intercepting the execution context or injecting service objects to the POJO at runtime.
如果使用一个综合的输入验证框架,许多输入漏洞,如SQL注入、CSRF和XSS,都是可以避免的。
Many intrusion vulnerabilities such as SQL injection, CSRF, and XSS are preventable using a comprehensive input-validation framework.
我希望所有的依赖注入框架在这方面大步的进化,而不是急于支持一些花哨的功能或者当前的习惯。
I would like to see all di frameworks evolve in this area a bit further, rather than rushing to support the fancy library or idiom of the day.
代码作为配置:类似于驱动依赖注入框架的XML文件。
Code as Configuration: These are things such as an XML file that drives a dependency injection framework.
有很多其他东西注入进语言,如人们在谈论事情和框架问题时的方式。
There are a lot of things that get inserted into the language, like the way that people talk about things and frame issues.
这是依赖项注入的基本形式,更完整的形式以Spring这样的框架表示。
This is a rudimentary form of dependency injection, as more fully expressed in frameworks like Spring.
作为一个简单依赖性注入框架,Blueprint对于We b容器与Blueprint容器之间的桥接存在完全相同的问题。
Blueprint as a plain dependency injection framework has exactly the same problem with bridging between the Web container and the Blueprint container.
依赖注入是通过使用像Spring这样的框架来执行的软件模式。
Dependency Injection is a software pattern that is usually implemented through the use of frameworks like Spring.
本文将通过POJO编程构建一个简单的SOA框架,它使用反射和Geronimo 的GBean依赖性注入来让组件去耦。
This article proposes a simple SOA framework through POJO programming that uses reflection and Geronimo's GBean dependency injection to enable component decoupling.
其次,它为平台提供了标准化、注解驱动、类型安全的依赖注入框架,方式类似于GoogleGuice。
Second it provides a standardised, annotation-driven, type-safe dependency injection framework for the platform similar in approach to Google's Guice.
因为我们使用了IoC,所以我们还想将该原理应用到我们正在使用的框架上,同时我们想用依赖注入(Dependency Injection,即DI)对应用的不同部分进行包装。
Since we are using IoC, we also want to apply the principle to the framework we are using and be able to wire together the different parts of our application using Dependency Injection (di).
新版本减少了对依赖注入框架如Sprint.NET的使用,同时将大量程序集引用减少到只有一个。
The new version includes a decreased footprint on dependency injection frameworks like Spring.NET and the amount of assemblies referenced is reduced to only one.
熟悉一下Guice或Spring等其他依赖注入框架会很有用。
Familiarity with Guice, or with another dependency injection framework such as Spring, would be useful.
如果您已经了解了DI,而且知道为什么要借助一个框架来使用DI,那么您可以跳到通过Guice进行基本注入小节。
If you already understand DI and know why you'd want a framework to help you with it, you can skip to the Basic injection with Guice section.
Guice是一个依赖项注入(DI)框架。
ObjectBuilder是一个用来构建依赖注入容器的框架。
ObjectBuilder was a framework which was used to build Dependency Injection containers.
所有的依赖关系(也就是三个接口)都可以由Spring框架用这些bean注入。
All the dependencies (that is, the three interfaces) can be injected by the Spring framework using these beans.
幸运的是,MartinFowler已经站出来解决这个问题,他与多个框架的构建者合作,把这种形式的解耦命名为依赖注入。
Fortunately, Martin Fowler has come to the rescue and, in collaboration with several framework builders, named this style of decoupling dependency injection.
毫无疑问,这些setter是框架所需的样板代码,如果不使用构造器注入也能避免这一点岂不美哉?
Again, these setters are framework induced boilerplate code. Wouldn’t it be nice if they could be avoided without the need to use Constructor injection everywhere?
应用推荐