beanfactory和applicationfactory区别
时间: 2023-09-12 11:04:15 浏览: 80
BeanFactory是Spring的基础容器对外接口,而ApplicationContext是完整的Spring容器。具体来说,ApplicationContext是由BeanFactory派生而来的,提供了更多面向实际应用的功能。在功能上,ApplicationContext提供了以下扩展功能:MessageSource(国际化资源接口)、ResourceLoader(资源加载接口)、ApplicationEventPublisher(应用事件发布接口)等。此外,ApplicationContext还支持Spring的AOP功能和Web应用。相比之下,BeanFactory只提供了配置框架和基本功能,不支持AOP功能和Web应用。因此,如果需要更多高级功能和扩展功能,建议使用ApplicationContext。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ApplicationContext 和beanFactory 和 factoryBean的区别以及联系](https://blog.csdn.net/weixin_40413961/article/details/106655017)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [简单了解Spring中BeanFactory与FactoryBean的区别](https://download.csdn.net/download/weixin_38748740/12744173)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文