In the following example, you have decided you want to create a
new pricing engine that prices handling costs separately from shipping. You
create a
SamplePricingEngine
that acts independently of the ShippingPricingEngine
.
1.
|
Create an interface called
SamplePricingEngine that extends PricingEngine.
|
2.
|
Create an implementation called
SamplePricingEngineImpl that extends PricingEngineService.
|
3.
|
Create a
SamplePricingInfo that extends the AmountInfo price holding class. |
4.
|
Create a calculator
called
SamplePricingCalculator and implementations of it that calculate and discount handling as
your business requires. |
5.
|
Modify the Promotions repository
definition file (by default,
pricingModels.xml ).
Add an item-descriptor for the Handling discount type and sub-descriptors for
the various
implementations of the
SamplePricingCalculator that you created. |
6.
|
Create properties files for the
SamplePricingEngine and each of the calculators. |
7.
|
Depending on your needs,
configure the new engine with some
preCalculators that calculate the base cost of
handling.
Pricing Engine Class Diagram :
|
No comments:
Post a Comment