Tree of rules

dear all,

i have a proj requirement like this.
I have list of master rules around 122. Each rule are store in the db. i need to write the business logic to what each of the rules does. if i sub-class each rules from the RuleLogic interface and override the execute method of the parent it becomes too much of sub classes. i feel that would eventually become crazy. can i use the factory method for this? factories generate the rules BL? which design patterns will suit this?

The above said rules are shown to the user(web interface). the user structures the rules like a tree and name it as a template. these template will be mapped to the customer he wishes. this structures will be configured to the database. periodically i take the templates and rule trees and execute it according to the customer. i will use the composite pattern for forming the tree? does this require any improvement with visitor pattern? each sub rules(sub-nodes) will be executed only when the parent node has validated to true. if true then sub-nodes will be executed with business logic? how do i join the BL and the rules?



  • edited November -1
    try to use Workflow.
  • edited November -1
    try to use jrules or jbpm instead of storing rules in database. you need to orchestrate rules depending upon BL.