Spring 進階一
Spring 進階一
以前創建對象都是通過new的方式
Spring提出新的方案
Ioc底層的原理和使用技術
一:xml配置
二:Dom4j解析xml
三:工程的設計模式
四:反射
Ioc入門案例
<beans xmlns="http://www.springframework.org/schema/beans" |
|
通過配置文件創建對象
class為創建對象類的全路徑
xml文件提示
對象創建的三種方式
第二種
第三種
Factory-method 為方法名
09-bean標簽常用屬性(id、class和name)
11-屬性註入介紹
Spring框架只支持前面兩種方式
構造方式
打印結果
Set註入
set註入對象
15-註入復雜類型屬性
P命名空間註入 還有很多比較復雜的註入 如 數組 list map。。。
Ioc和dI的區別
Spring 進階一