design patterns - Choice of language/paradigm for a rule matching system -
i maintain internal java application nothing more set of rules, implemented amounts massive cascade of if/else statements.
if(string1.equals(earlierstring)){ if(!!string2.equals("yadayada")){ errorreport.add("blahblahyadayda error."); } else{ if(string3.equals("maybenot!")){ errorreport.add("possible error"); } } }
and on , forth...
going forward, have significant freedom choose how rewrite it, if requires learning time , training, no options off table. languages , high-level design paradigms fit problem best? main goal make easier update minor/moderate rule changes.
the context providing pretty obscure, nevertheless recommend have @ clips, @ least see if rule programming paradigm suits needs.
the advantage rule based languages offer free engine evaluate rules , fire them according criterion (is maybe rule set?) allowing specify rules in declarative fashion (they 'apart' engine not need define).
each rule can viewed 2 part template:
part_to_match => actions_to_do
clips engine works forward chaining rules, prolog backward chaining them.
Comments
Post a Comment