on 08-19-2018 5:18 PM
Hello Experts,
I'm currently trying to override the populate method in the OneTimeChargeEntryPopulator since I added new attribute that I want to be populated. So, I've created the custom populator which extends the OneTimeChargeEntryPopulator and I've added the new spring configurations.
However my question is, should I create custom classes that extend any class that calls the old populator in order to make them call the new populator? or is there a best practice that should be followed?
. For example your cartFacade is calling your OneTimeChargeEntryPopulator. The best strategy is to create a new populator say 'CustomOneTimeChargeEntryPopulator'. Create bean definiton for this populator in your extension-spring.xml file and give the same alias as 'OneTimeChargeEntryPopulator'. Once that is done, your application context will know that it has to pick your 'CustomOneTimeChargeEntryPopulator'. Sample bean definiton below.
<alias name="defaultOneTimeChargeEntryPopulator" alias="chargeEntryPopulator" />
<bean id="defaultOneTimeChargeEntryPopulator" class="com.outofbox.populator.OneTimeChargeEntryPopulator">
</bean>
<alias name="customOneTimeChargeEntryPopulator" alias="chargeEntryPopulator" />
<bean id="customOneTimeChargeEntryPopulator" class="com.xxx.populator.CustomOneTimeChargeEntryPopulator"
parent="defaultOneTimeChargeEntryPopulator">
</bean>
the first bean definiton is OOB, the second one is yours which will override the default one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.