How to do it...
The sample customization is simple; however, the difficulty begins when you have to handle which customization you have to choose from among those available. Sure, you can define some sort of parameters; but your code will get a lot of if just to understand which calculation to apply. And, even worse, a change in one of your criteria could break something in another. Bad approach! We can configure our software without if statements using RTTI. In this recipe, all the calculus engines are implemented in four different classes in four different units. You can also define all the criteria in only one unit, but it is not mandatory.
In the following table, we see a summary of the customers and the customizations implemented:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access