Spring IOC Container Class Notes
Spring IOC Container Class Notes
Container
Ramesh
RameshFadatare
Fadatare((Java
JavaGuides)
Guides)
Tight Coupling
Car
Bicycle
Car
Bicycle
fi
Creating Objects Manually
JVM
Car
Traveler
Cycle
fi
n
fi
fi
)
BeanFactory Container
1. Responsible for creating the beans, con guring
the beans and managing the bean’s entire life-
cycle.
fi
ApplicationContext Container
1. Responsible for creating the beans, con guring the beans and
managing the bean’s entire life-cycle
2. Enterprise Application Features
• It provides messaging (i18n or internationalization) functionalit
• Event publication functionalit
• Annotation-based dependency injectio
• Easy integration with Spring AOP features
• Supports almost all types of bean scopes
fi
@Primary Annotation
We use @Primary annotation to give higher
preference to a bean when there are multiple beans
of the same type.
fi
fi
1. Create Configuration class with @Configuration annotation