I have a bunch of rules to be injected into a set of classes, something like below:
<bean id="rule1" class="com.vikdor.rules.Rule1" />
<bean id="rule2" class="com.vikdor.rules.Rule2" />
<bean id="rule3" class="com.vikdor.rules.Rule3" />
<bean id="rule4" class="com.vikdor.rules.Rule4" />
<bean id="rule5" class="com.vikdor.rules.Rule5" />
<util:list id="commonRules">
<ref bean="rule1" />
<ref bean="rule3" />
<ref bean="rule5" />
</util:list>
<util:list id="normalInvRules">
<!-- Include common rules -->
<ref bean="rule4" />
</util:list>
<util:list id="prepaidInvRules">
<!-- Include common rules -->
<ref bean="rule2" />
</util:list>
How can I include the common rules list in the lists corresponding to normalInvRules
and prepaidInvRules
?
The number of rules (e.g. rule1, rule2 etc.,) are more and the number groups (normalInvRules, prepaidInvRules etc.,) are also more. So, I am wondering if there is a way to avoid repeating the common rules and just list only the specific ones and include the reference to the common list.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…