Whenever someone describes the difference between BeanFactory and ApplicationContext, an argument, "Automatic registration of BeanPostProcessor", is very common in favour of ApplicationContext interface. Unfortunately, I don't understand these magic words. Can someone elaborate, what does "automatic registration" mean here?

Many thanks!

BeanFactory vs ApplicationContext http://docs.spring.io/spring/docs/2.5.x/reference/beans.html#context-introduction-ctx-vs-beanfactory

有帮助吗?

解决方案

You shouldn't actually care unless you have a very specific use case. In certain environments, you may want to turn off some additional features that ApplicationContext has over BeanFactory. These are summarized in this table

As for "Automatic registration of BeanPostProcessor", the ApplicationContext will detect beans that implement BeanPostProcessor and will use them to enrich the context while it is loaded. This is a very powerful feature of Spring, check Container extension points

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top