Key points -
----------------------------------------------------------------------------------------------------------------
1. Spring is an open-source framework with main intention to achieve loose-coupling.
2. Spring uses layered approach which means user/developer has a choice to use functionality if needed.
Example -
Developer can choose AOP functionality to implement
Developer can choose to design appication with Spring MVC.
Developer can choose to integrate with ORM (Hibernate).
3. Spring core module is based on IOC container ( also known as Dependency Injection).
4. org.springframework.beans and org.springframework.context packages are used for DI.
5. BeanFactory interface points -
a. Creates an object of the bean when bean name is specified in getBean() method of BeanFactory interface.
b. "Factory" - this term means creation of objects at one place and user does not have to worry object creation.
6. ApplicationContext interface points-
a. Creates an object of the bean when bean name is specified in getBean() method.
b. Provides internationalization support - means same application can be translated into different languages based on the location.
c. Publishes event to the registered beans as listeners.
----------------------------------------------------------------------------------------------------------------
1. Spring is an open-source framework with main intention to achieve loose-coupling.
2. Spring uses layered approach which means user/developer has a choice to use functionality if needed.
Example -
Developer can choose AOP functionality to implement
Developer can choose to design appication with Spring MVC.
Developer can choose to integrate with ORM (Hibernate).
3. Spring core module is based on IOC container ( also known as Dependency Injection).
4. org.springframework.beans and org.springframework.context packages are used for DI.
5. BeanFactory interface points -
a. Creates an object of the bean when bean name is specified in getBean() method of BeanFactory interface.
b. "Factory" - this term means creation of objects at one place and user does not have to worry object creation.
Resource res = new FileSystemResource("beans.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);
or
ClassPathResource res = new ClassPathResource("beans.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);
or
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
new String[] {"applicationContext.xml", "applicationContext-part2.xml"});
// of course, an ApplicationContext is just a BeanFactory
BeanFactory factory = (BeanFactory) appContext;
6. ApplicationContext interface points-
a. Creates an object of the bean when bean name is specified in getBean() method.
b. Provides internationalization support - means same application can be translated into different languages based on the location.
c. Publishes event to the registered beans as listeners.

No comments:
Post a Comment