Difference Between Application Context and Bean Factory in Spring
Even though both are responsible for bean instantiation and wiring but there are some differences between them.
Bean Factory | Application Context |
---|---|
Instantiate a bean when ever required. i.e Lazy Instantiation | Pre instantiate all the beans at the time of container creation |
Doesn't support annotation based dependency injection | Supports annotation based injection |
Doesn't publish events to listeners | Application contexts can publish events to beans that are registered as listeners |
Doesn't provide support for internationalization i.e i18n | supports internationalization |
Provides Basic IOC and DI (Dependency Injection) features | Application Context provides advanced features such as JNDI access, EJB integration, remoting, along with IOC and DI |
Comments
Post a Comment