title: reading the bean definition from xml file Spring
body: <p>While reading the bean definition from an xml file, which of the below two methods is best. I remember reading about <code>Resource</code> , that using this is fast or something like that but don't know exactly.</p>
  
  <pre><code>Resource rs = new ClassPathResource("hello.xml");
  BeanFactory  factory = new XmlBeanFactory(rs);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>BeanFactory  factory = new XmlBeanFactory(new FileInputStream("myBean.xml"));
  </code></pre>