Spring Bean Definition
by, 07-07-2012 at 06:43 PM (658 Views)
The beans are the object that forms the backbone of any application and the Spring IoC container manges these beans. The Spring IoC container is responsible for instantiating, assembling and managing of a bean object. The configuration metadata is used to create these beans which are sent to container. For example, they are sent in the form of XML configurations.
The configuration metadata information is contained by the bean definition which is required to know the following by the container.
• The process of bean of creation
• Life cycle of bean
• Dependency of a bean
Following properties are translated by the above metadata configuration which is used to make bean definition.
• class: Bean class is specified by this attribute which is responsible for creating the bean. Also this attribute is mandatory.
• name: The bean identifier is uniquely specified by this name attribute. The bean identifier is specified by an id or name of the bean in the XML configuration file.
• scope: This attribute is used to specify the objects scope that are created using a bean definition.
• constructor-org: This attribute is responsible for injecting dependencies.
• properties: This attribute is responsible for injecting dependencies.