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); |
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
这有帮助吗? 是 否
用户评价最有帮助的内容:
- 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.