YoungMan(BeautifulGirl beautifulGirl) {
this.beautifulGirl = beautifulGirl;
}
复制代码
public class YoungMan {
private BeautifulGirl beautifulGirl;
public void setBeautifulGirl(BeautifulGirl beautifulGirl) {
this.beautifulGirl = beautifulGirl;
}
}
复制代码
Resource 体系. org.springframework.core.io.Resource,对资源的抽象。它的每个实现类都表明了一种资源的访问策略,如 ClassPathResource、URLResource、FileSystemResource 等。 spring
ResourceLoader 体系. 有了资源,就应该有资源加载,Spring 利用 org.springframework.core.io.ResourceLoader 来进行统一资源加载 bash
BeanFactory 体系 org.springframework.beans.factory.BeanFactory,是一个很是纯粹的 bean 容器,它是 IoC 必备的数据结构,其中 BeanDefinition 是它的基本结构。BeanFactory 内部维护着一个BeanDefinition map ,并可根据 BeanDefinition 的描述进行 bean 的建立和管理 数据结构
BeanDefinition 体系 org.springframework.beans.factory.config.BeanDefinition ,用来描述 Spring 中的 Bean 对象 ui
BeanDefinitionReader 体系 org.springframework.beans.factory.support.BeanDefinitionReader 的做用是读取 Spring 的配置文件的内容,并将其转换成 Ioc 容器内部的数据结构 :BeanDefinition 。 this
ApplicationContext 体系 org.springframework.context.ApplicationContext ,这个就是大名鼎鼎的 Spring 容器,它叫作应用上下文,与咱们应用息息相关。它继承 BeanFactory ,因此它是 BeanFactory 的扩展升级版,若是BeanFactory 是屌丝的话,那么 ApplicationContext 则是名副其实的高富帅。因为 ApplicationContext 的结构就决定了它与 BeanFactory 的不一样,其主要区别有:spa
注:本文摘自芋道源码 博客翻译