I'm designing a simple rule engine. Let me start by giving an overview.
The engine is initialized with a configuration file which specific the rules to be run and also parameters that are intended to be used by these rules.
Example:
I have a incoming order object and I will would like to do some sanity check on it like the order quantity cannot be greater than some quantity X ( x is passed as a parameter to the engine. ) This is a simple example of a parameter being passed.
A complex example:
Some order Type.Some region.Some desk.Order Quantity = X
Some order Type.Some region.Some desk.Some trader.Quantity = y.
Some order Type.Some region.Some Product.Daily Volume = A
Some order Type.Some region.Some desk.Daily Volume = B
A lot of parameters like these are used to initialize the engine which are intended to be used by the rules.
Question:
How should these initialization parameters be passed to API ? -- JSON , XML ???
What is the best software design practice to represent and process and store these parameters so that the rules can use this information ( like what's the quantity allowed for a trader group ? to do sanity checks on the incoming order object )
I'm planning to implement this in C++
Thanks in advance