The difference between ApplicationContext and beanfactory containers in spring: These two containers are different for the time when the beans are created:
ApplicationContext context = new Classpathxmlapplicationcontext ("Applicationcontext.xml");
1) When the ApplicationContext container is initialized, all of its beans (objects) are created
Cons: Consumes system resources (memory, CPU, etc.)
Advantages: Fast response times
Beanfactory factory=newxmlbeanfactory (New Classpathresource ("Applicationcontext.xml"));
2) objects in the Beanfactory container are not created when the container is initialized, but are created when the object is actually acquired
Cons: Relatively speaking, slow response times
Pros: Not much use of system resources
In general development is commonly used for the ApplicationContext container to load the spring configuration file, because with the development of hardware resources, memory is secondary, the response speed can make the user experience better!
The difference between ApplicationContext and beanfactory containers in spring