laptop_opkiezels2.gif

The rise of rule based systems in Java
Knowledge systems, and in particular rule-based systems, exist for quite a long time now. Nevertheless, they never succeeded in becoming mainstream and you will not find them in typically information systems. More attention for knowledge and business rules however, have revived the interests in rule based systems and related subjects.

There are three main reasons to choose a rule-based approach for developing an information system. The first reason is the complexity of the knowledge.  In a procedural approach a complex collection of rules could lead to a chaotic structure of nested if then statements. In a rule-based system the dependencies between if then rules are determined by the reasoning algorithm and not by the sequence in which they are specified in a method. The second reason is the maintainability of the knowledge. The design principle of separation of concerns can also be applied to knowledge. By separating the knowledge from the rest of the program, the maintainability of the knowledge will be increased. The third reason is the quality of the knowledge. A correct knowledge representation makes it easier to inspect and judge the knowledge. Code inspection by peers is used to increase the quality of a program. Similarly, inspection of the knowledge rules by an expert could increase the quality of the information system.
 
Apart from unfamiliarity, several reasons exist that explain why rule based systems are not very common. The first is the lack of complexity of the knowledge. Most insurance acceptation systems, for instance, do not contain a lot of rules but they do contain exceptions that are very difficult to model. A middle-aged man should not have very much difficulty to get his middleclass car insured. A young and inexperienced person with a very expensive sports car would be rejected, unless he is the son of a CEO of a big company who happens to be a major customer of the insurance company.
 
Also in the field of knowledge representation a lot can be gained. In general, the IT consultant is not the expert who has all the knowledge about the subject to model, and the expert is no IT consultant. Nevertheless, these two have to agree about the completeness and correctness of the knowledge that will be used in the information system.  Knowledge represented in a XML format like BRML will be hard to grasp by the expert. A simple example how a rule in Drools should be represented will make this clear:
 
<rule-set name="cheese rules"
    xmlns="http://drools.org/rules"
    xmlns:java="http://drools.org/semantics/java">
 
    <rule name="Bob Likes Cheese">
      <parameter identifier="bob">
        <class>org.drools.examples.simple.Bob</class>
      </parameter>
      <java:condition>bob.likesCheese() == true</java:condition>
      <java:consequence>
        System.out.println( "Bob likes cheese." );
      </java:consequence>
    </rule>
</rule-set>
 
Jess, an other Java rule engine uses a Lisp like scripting language to specify knowledge rules.  Knowledge systems that can handle natural language used by the expert do not exist yet.
 
Nevertheless, it looks like the use of rule-based system will increase in the near future. More and more development environments and application servers will provide support for these kind of techniques, and developers will automatically use the provided techniques. The attention for business rules and the need for more explicit representations of knowledge will help increase the use of rule-based systems.  This will not result into classical knowledge systems, for that knowledge rules differ too much from business rules .
 
Interesting links:
Drools: http://labs.jboss.com/portal/jbossrules
CommonRules: http://www.alphaworks.ibm.com/tech/commonrules
Jess: http://herzberg.ca.sandia.gov/jess/
JRS 94: http://java.sun.com/developer/technicalArticles/J2SE/JavaRule.html
 
leo blommers.jpgAuthor: Leo Blommers
Finalist IT Group (The Netherlands)
email: , tel. +31 10 217 08 00

© 2000-2007 Finalist IT Group BVIAll rights reservedIinfo@finalist.com