I need to automate some very complex business rules (insurance) in my Delphi application. To date we have used a scripting engine to maintain these rules externally (many if/then/else type statements) but this has become difficult to maintain and impossible to test and it is difficult to validate these with the end user.
Most formal rules engines I have looked at do not integrate well with Delphi (currently using D2007 but plan to move to 64 bit XE2 this year).
Is anyone aware of any products or has used any products or techniques that I could use that would help?
Scripts are indeed a good way to handle parts of business logic that is likely to change.
However, I suspect that the problem you have is that you lack the proper object model. Having many IFs indicates that you have centralized logic and then decisions depend on many factors which you all have to check and end up with a mess.
This is symptomatic of working with data directly instead of working with objects. When you manipulate data directly you have to know all rules that apply.
I always advocate model centric solutions. With properly designed object model the responsibilities are spread among the classes in the model, thus removing hotspots. This corresponds with the Single responsibility principle and Don't repeat yourself.
The challenge, of course, is to model the problem domain, but that's the path I would recommend exploring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With