Mark the abstract base class definition as abstract by using the abstract
attribute , and in the concrete class definition , make the parent
attribute be the name of the abstract class 's bean name
Something like this:
<bean id="abstractBaseClass" abstract="true" class="pacakge1.AbstractBaseClass">
<property name="mailserver" value="DefaultMailServer"/>
</bean>
<bean id="concreteClass1" class="pacakge1.ConcreteClass1" parent="abstractBaseClass">
<!--Override the value of the abstract based class if necessary-->
<property name="mailserver" value="AnotherMailServer"/>
</bean>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…