ApplicationContext和BeanFactory有什么区别

BeanFactory是Spring中非常核心的组件,表示Bean工厂,可以生成Bean,维护Bean。

ApplicationContext继承了BeanFactory,它拥有BeanFactory的所有特点,也是一个Bean工厂,除此之外它还继承了EnvironmentCapable、MessageSource、ApplicationEventPublisher等接口,使其拥有了获取系统环境变量、国际化、事件发布等功能,这是BeanFactory所不具备的。

你可能感兴趣的:(spring,java,spring)