Question: what is Bean Factory, have you used XMLBeanFactory?Answer: BeanFactory is factory Pattern which is based on IOC design principles. It is used to make a clear separation between application configuration and dependency from actual code.XmlBeanFactory is one of the implementation of bean Factory which we have used in our project. org.springframework.beans.factory.xml.XmlBeanFactory is used to create bean instance defined in our xml file. BeanFactory factory = new XmlBeanFactory(new FileInputStream("beans.xml")); Or ClassPathResource resorce = new ClassPathResource("beans.xml"); XmlBeanFactory factory = new XmlBeanFactory(resorce); |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Spring?
- What are the advantages of Spring framework?
- What are features of Spring?
- What are the types of Dependency Injection Spring supports?
- Please describe the basic modules of Spring Framework.