Tuesday, 22 October 2013

Difference between BeanFactory and ApplicationContext in Spring

Difference between BeanFactory and ApplicationContext in Spring




BeanFactory
Application Context
1
Does not support the Annotation based dependency Injection.
Support Annotation based dependency Injection.-@Autowired, @PreDestroy
2
Does not support way to access Message Bundle(internationalization (I18N)
Support internationalization (I18N) messages.
3
Doesn’t support.
Support  many enterprise services such JNDI access, EJB integration, remoting.
4
Does not Support
Application contexts can publish events to beans that are registered as listeners
5
By default its support Lazy loading
its By default support Aggresive loading
6
org.springframework.beans
org.springframework.context
7
BeanFactory factory = new XmlBeanFactory(new FileSystemResource("spring.xml"));

ApplicationContext factory = new ClassPathXmlApplicationContext("spring.xml");


No comments:

Post a Comment

Very Impotent Links for Java and Portal development development

Jar Download for Spring  Maven Or Gradel Dependency for Spring