spring aoc控制反轉學習

spring是一個重要的j2ee輕量級框架,其中最重要的兩個概念爲aoc(inversion of control)-控制反轉,即依賴注入dependence injection。

三種依賴注入的方式,構造方法注入(constructor injection)、setter方法注入(setter injection)以及接口注入(interface injection)。可以參考matin flower寫的文章“inversion of control containers and the dependency injection pattern”,描述得十分詳細。

Spring提供了兩種容器類型:Beanfactory和ApplicationContext。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章