Results 1 to 3 of 3
  1. #1
    vramanjikjava is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Unhappy difference between BeanFactory and ApplicationContext?

    what is the difference between BeanFactory and ApplicationContext?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,225
    Rep Power
    20

    Default Re: difference between BeanFactory and ApplicationContext?

    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    arfeen.java is offline Member
    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Default Re: difference between BeanFactory and ApplicationContext?

    Using BeanFactory one can instantiate the beans which will be managed by IOC container.
    Bean configuration is defined in XML (typically). To read that xml, need a resource (like ClassPath, File)
    by BeanFactory.
    Example - XmlBeanFactory factory = new XmlBeanFactory
    (new ClassPathResource("Beans.xml"));

    In case of ApplicationContext you don't have to provide that resource--
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("Beans.xml");

    As ApplicationContext extends the BeanFactory.

    Apart from this benefit, ApplicationContext provides more features like i18n etc. Please follow the link above given by Tolls.

Similar Threads

  1. What is the difference?
    By sublixt in forum New To Java
    Replies: 2
    Last Post: 08-14-2011, 04:37 AM
  2. What is the difference between
    By arnab321 in forum New To Java
    Replies: 2
    Last Post: 01-19-2009, 05:49 AM
  3. difference
    By nishant in forum New To Java
    Replies: 2
    Last Post: 09-17-2008, 07:04 PM
  4. Replies: 2
    Last Post: 06-12-2007, 05:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •