top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the importance of Spring bean configuration file?

+1 vote
580 views
What is the importance of Spring bean configuration file?
posted Aug 23, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

As its definition says "The objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. These beans are created with the configuration metadata that you supply to the container. For example, in the form of XML <bean/> definitions which you have already seen in the previous chapters."
Here,Spring IoC container classes are part of org.springframework.beans, and org.springframework.context packages and provides us different ways to decouple the object dependencies.So we achieve IoC mechanism using beans.
The spring configuration file is important as we define all beans here and these beans are initialized when we create an instance of spring ApplicationContext.After initialization, we can use this applicationContext instance to get any bean instances.

Reference: 1. https://www.tutorialspoint.com/spring/spring_bean_definition.htm

answer Aug 23, 2017 by Shivam Kumar Pandey
...