Spring also has an abstract bean. You only need to set the abstract attribute to true in the configuration file. It does not configure the class attribute because it will not be instantiated. When the bean of another spring inherits the abstract bean, You need to configure its parent attribute. If the parent bean is configured with a class, the sub-bean can be configured or not. If this parameter is not set, it is instantiated Based on the parent class. If it is configured, It is instantiated based on its own configuration. Some of its sub-bean parameters or methods can inherit from the parent bean, but some cannot. These are also determined by some configuration attributes in the configuration file. For details, refer to attribute configuration.
The inheritance of spring bean differs from that of Java Bean in the following ways:
1. Spring bean and parent can be of different types, but the child of Java inherits the parent's enhancement and characterization.
2. Spring bean integration is actually the relationship between instances (Object-Oriented). It is not a continuation of parameter values, but a relationship between classes in Java. Is the continuation of methods and properties.
3,SpringNeutronBeanCannot be a parentBeanUse, does not have polymorphism; andJavaSubclass instances in can be used as parent class instances.