Dashboard > OpenSource Project > ... > Spring > 入門 12 - ApplicationContext介面
OpenSource Project Log In   View a printable version of the current page.
入門 12 - ApplicationContext介面
Added by minqing, last edited by 良葛格 on Nov 19, 2004  (view change)
Labels: 
(None)

Reference by caterpillar ,caterpillar

在Spring中,BeanFactory提供的是個比較API層次的功能,就像是BeanUtil之類的,感覺上不像是一個框架層次的使用,Spring提供了應用程式框架層次的介面:ApplicationContext。

org.springframework.context.ApplicationContext繼承自多個介面:ApplicationEventPublisher、HierarchicalBeanFactory、ListableBeanFactory、MessageSource、ResourceLoader,其中ListableBeanFactory繼承自BeanFactory。所以除了BeanFactory的功能之外,ApplicationContext還提供了以下的功能:

*訊息解析(resolve messages),支援國際化(internationalization):繼承自MessageSource介面的功能。
*載入檔案資源(load file resources):繼承自ResourceLoader的功能。
*發佈事件(publish events):以註冊事件傾聽者的方式提供。

相關的主題在之後會一一介紹,先看看下圖的ApplicationContext介面繼承圖瞭解一下繼承關係:

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.1.5a Build:#411 Mar 16, 2006) - Bug/feature request - Contact Administrators