I am working on a decision engine / rule evaluation engine. For example:
Input: Customer and all the offences done by the customer
Output: Consequences of the offences
A sample case would be:
Input: Customer(Jhonny Chimpo, 999-00-1111), Offences ( Broke window, slapped boss, kicked team lead in his groin)
Output: Gets pink slip
So the piece of code I want to write evaluates different offences based on rules for each offence and combined offence. The current code is just a maze of if and else statements. I am sure such business problems are common. What design/enterprise pattern is usually used to solve a problem like this?
Is it the specification pattern? I want the code to be open for extension, clean and flexible.