Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top