mercredi 27 janvier 2016

Object oriented design for rules engine

I need some help from OOP guys to help me decide the structure of a pay rules engine I want to develop for employee's attendance. Finally I want a jar that takes csv input and returns csv output. This jar will take attendance shifts and rules as input and provide me back the outputs ie calculations from rules applied on those shifts like overtime hours and respective pay.

Basically I will have a GenericEngine for normal employee's overtime hours and say some extended functionalities according to state overtime laws like one custom OregonEngine, that will process a specific rule for premium hours(this wont be provided by GenericEngine)

Situation as I know it's going to be like:

  1. RulesProcessor will take input as shiftsList and rulesList.
  2. If GenericEngine can process all the rules on all the shifts then it'll do it or ask specificEngine like OregonEngine to do so.
  3. Every custom engine like OregonEngine can use GenericEngine but not necessarily.
  4. RulesProcessor should be able to do calculations using Generic and Custom engines. 5.Calculations has to be stored somewhere because some rule ,say weekly overtime, might require it.

Aucun commentaire:

Enregistrer un commentaire