IoC container文档重点段落翻译

This chapter covers the Spring Framework implementation of the Inversion of Control (IoC) [1] principle. 
本章将介绍控制反转(IoC)的Spring框架实现。
IoC is also known as dependency injection (DI).
IoC也被认为是依赖注入。
It is a process whereby objects define their dependencies,
它是一个定义对象依赖关系的过程,
that is, the other objects they work with, 
与之工作的其他对象,
only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method. 
往往通过构造参数、传递参数给工厂方法、或者属性设置来进行构造。
The container then injects those dependencies when it creates the bean. 
当创建这些Spring Bean对象的时候,容器将会自动注入这些依赖关系。
This process is fundamentally the inverse, 
这个过程从根本上说是相反的,
hence the name Inversion of Control (IoC), 
正如IoC的名称(控制反转)一样,
of the bean itself controlling the instantiation or location of its dependencies by using direct construction of classes, or a mechanism such as the Service Locator pattern.
通过类的构造函数或者服务定位器模式来控制依赖对象的实例化和定位。


The org.springframework.beans and org.springframework.context packages are the basis for Spring Framework’s IoC container. 
org.springframework.beans和org.springframework.context包是Spring IoC容器的根本。
The BeanFactory interface provides an advanced configuration mechanism 
BeanFactory接口提供了高级配置机制,
capable of managing any type of object.
能够管理任何类型的对象。
ApplicationContext is a sub-interface of BeanFactory.
ApplicationConext是BeanFactory的子接口。
It adds easier integration with Spring’s AOP features; 
它添加了与Spring AOP更容易集成的特性,
message resource handling (for use in internationalization), event publication; 
如消息资源处理(用于国际化)、事件发布
and application-layer specific contexts such as the WebApplicationContext for use in web applications.
以及应用程序层特定的上下文,例如Web应用程序的WebApplicationContext。

In short, the BeanFactory provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. 
简而言之,BeanFactory提供了配置框架和基本功能,而ApplicationContext添加了更多企业应用特定的功能。
The ApplicationContext is a complete superset of the BeanFactory, 
ApplicationContext是BeanFactory的一个完整超集。
and is used exclusively in this chapter in descriptions of Spring’s IoC container. 
在本章中,用于介绍Spring IoC容器。
For more information on using the BeanFactory instead of the ApplicationContext, refer to The BeanFactory.
如果想了解更多BeanFactory而不是ApplicationContext的更多信息,请参阅 The BeanFactory。


In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. 
在Spring中,那些构建应用程序主干并被Spring容器管理的对象称之为Beans。
A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container.
Bean是由Spring IoC容器初始化、装配和管理的对象。
Otherwise, a bean is simply one of many objects in your application. 
否则,Bean只是你应用程序中众多对象的一个。
Beans, and the dependencies among them, are reflected in the configuration metadata used by a container.
Bean及其之间的依赖关系反映在Spring容器的配置元数据中。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值