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
注:本文摘自芋道源碼 博客翻譯