.net - What pattern/patterns work best for developing rule/decision engine -


I'm working on decision engine / rule assessment engine. For example:

Input: All crimes committed by the customer and customer

Output: The result of the crime

A sample case will be:

< P> Input: Customer (Jhoney Chimpo, 99 -00-1111), Crime (Broke window, Slap boss, Lead team lead in his tongue)

Output: Pink slips

So I want to write code piece evaluating various crimes based on the rules of each offense and joint crime Is there. The current code is just a maze of other statements if I am sure that such business problems are common, which design / enterprise pattern is used to solve such a problem?

Is this the specification pattern? I want to open the code for expansion, cleanliness and flexibility.

Basically the business rules appear

  All the rules: if & Lt; Condition & gt; Then doAction ();  

Using scores to seriously classify all the crimes, perhaps additional bonuses for "bad reactants", some offenses can be timed and whatever is needed

Then an algorithm can be a good draft:

  • An average amount of all customers (weighted)
  • Comparison of the maximum
  • < / Ul>

    It is using data structures instead of a lot (possibly darkly nested) if so .. Look ..


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -