Bean Definition Inheritance in Spring
by, 07-07-2012 at 07:20 PM (981 Views)
Following information is contained by a bean definition:
• Configuration information
• Constructor arguments information
• Container specific information like method initialization
• Property values information
• Names of static factory methods
Configuration data is inherited from the parent definition by the child bean definition. Some values are added or overridden by the child definition. There are no direct concerns between the java class inheritance and Spring Bean definition inheritance. Only the inheritance concept is same between the two. A parent bean definition can be defined as a template and the required information is inherited by the child beans from the parent bean.
A child bean definition is indicated in case where XML based metadata configuration is used when parent attributes are used, the value of attribute is specified as parent bean.