beginnerSpring Fundamentals

What is the difference between BeanFactory and ApplicationContext in Spring?

BeanFactory is the most basic container interface, providing lazy initialization (beans are created only when first requested) and the fundamental DI capability. ApplicationContext extends BeanFactory and adds enterprise features on top — eager singleton initialization at startup, event publishing, internationalization support, and easier integration with Spring AOP — which is why virtually every real Spring/Spring Boot application uses ApplicationContext rather than BeanFactory directly.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What is the difference between BeanFactory and ApplicationContext in Spring?

Next Step

Continue to How do you handle global exceptions in Spring Boot? Explain @ControllerAdvice.← Back to all Spring Boot & Microservices questions