Rhyme/Spring5.0.2.RELEASE官方英文文档学习笔记(1) Introduction to the Spring IoC container and beans
来源:互联网 发布:淘宝商城怎么开店 编辑:程序博客网 时间:2024/05/22 08:15
1.1Introduction to the Spring IoC container and beans
1.1. Introduction to the Spring IoC container and beans
This chapter covers the Spring Framework implementation of the Inversion of Control (IoC) [1] principle. IoC is also known as dependency injection (DI). 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. This process is fundamentally the inverse, hence the name Inversion of Control (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.
IOC是一个对象主动确定他们所需的依赖并通过Factory模式或Service Locator 模式
来创建他们所需的依赖的过程。也就是说主动权对象需要什么依赖,IOC容器主动给他们注入对应的关系
The org.springframework.beans and org.springframework.context packages are the basis for Spring Framework’s IoC container. The BeanFactory interface provides an advanced configuration mechanism capable of managing any type of object. ApplicationContext is a sub-interface of BeanFactory. It adds easier integration with Spring’s AOP features; message resource handling (for use in internationalization), event publication; and application-layer specific contexts such as the WebApplicationContext for use in web applications.
org.springframework.beans和org.springframework.context
是spring IOC容器实现的基础。
BeanFactory接口提供了一个先进的能够管理任意类型对象的机制
ApplicationContext是BeanFactory的一个子接口,它集成了更简单的Spring AOP功能的实现
WebApplicationContext是web应用中一个具体的应用层的上下文
In short, the BeanFactory provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. The ApplicationContext is a complete superset of the BeanFactory, and is used exclusively in this chapter in descriptions of Spring’s IoC container. For more information on using the BeanFactory instead of the ApplicationContext, refer to The BeanFactory.
简单来说,ApplicationContext比Beanfactory拥有更多基于企业应用的功能,也就是说ApplicationContext是BeanFactory的一个超级增强版
In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the dependencies among them, are reflected in the configuration metadata used by a container.
只有被spring ioc容器管理的主要的对象才能叫bean
Beans和他们的依赖关系被映射在配置元数据中,并被ioc容器所使用
- Rhyme/Spring5.0.2.RELEASE官方英文文档学习笔记(1) Introduction to the Spring IoC container and beans
- Introduction to the Spring IoC container and beans
- Configuring Beans in the Spring IoC Container
- 【Spring Framework Reference 简记】—— IoC container and Beans(一)
- Kafka Introduction 官方文档学习笔记
- 《Spring5官方文档》新功能
- Introduction to Languages and the Theory of Computation--Chapter 1 学习笔记
- Rhyme/Spring 完整学习笔记
- spring 官方文档,学习笔记
- Rhyme/Spring 1.2.3. Using the container 容器的使用
- spring-reference-The IoC container的翻译笔记(自己用)
- The IoC container——SpringFrameWork学习笔记
- Spring学习笔记——IOC的Introduction
- Rhyme/Spring 1.2. Container overview
- Java学习笔记(1)Introduction to Computers, Programs, and Java
- Spring官方文档学习(1)
- 码农小汪-spring框架学习之2-spring IoC and Beans 控制反转 依赖注入 ApplicationContext BeanFactory
- Rhyme/Spring MVC完整学习笔记
- PCB设计中的的3W规则和20H原则
- 异常
- hdu_2682_prime
- 2-8·crontab计划任务管理
- 根据图片路径,把图片转为byte数组
- Rhyme/Spring5.0.2.RELEASE官方英文文档学习笔记(1) Introduction to the Spring IoC container and beans
- 数据库连接池
- [Java数据结构]简单排序之插入排序
- 用java计算一个目录里所有文件的大小
- HDU 5916
- 代码重构之Spring+工厂+策略模式
- JS——事件冒泡(1)
- c++中的处理类型的三种方式
- 爬虫实战:基于 HtmlParser 实现网页链接的提取