0

From what I have read we should use BeanFactory when we are only looking for a light weight IOC quoting from Pro Spring 2.5

Unless you are looking for a really lightweight IoC solution for your application, you should almost certainly use ApplicationContext.

Is there any other compelling reason to use BeanFactory over ApplicationContext?

1

1 Answer 1

1

BeanFactory will only carry out Bean instantiation and wiring. ApplicationContext extends the functionality of BeanFactory and includes support for BeanPostProcessor which is required for Transactions and AOP.

The only real advantage of using BeanFactory is memory consumption if your app is only using spring for IOC.

Please also read the spring docs for a more in depth answer:

3.8.1. BeanFactory or ApplicationContext?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.