Hi Franz,<br><br>just a few thoughts... <br><br>"Design" in connection with rule-based systems has several flavours. Some of the terms I'm going to use here are not well-established, so I'll use quotes to mark them. All of this is off-the-cuff, and certainly sketchy.<br>
<br>There is the "large-scale design" of a RB application. This is where you decide about<br><ul><li>fact types, i.e., the type of ontology you'd like to use (if not Pojos) <br></li><li>the kind of session: stateful (truly a production system) or stateless (basically just derivative, no fact updates).</li>
<li>data flow: how and when to insert facts, how and when to extract results</li><li>architecture of the embedding (Java) application</li><li>whether to use CEP</li><li>...<br></li></ul>Then there is "rule design patterns", something that's akin to rule programming techniques, mostly decisions about<br>
<ul><li>when and how to use "auxiliary facts",</li><li>how to use or not use salience (i.e., rule priority)<br></li><li>how to order patterns within a rule,</li><li>when to use FOP quantifiers or more sophisticated CEs (e.g. accumulate)<br>
</li><li>whether to flatten lists into facts or leave them as a complex attribute,</li><li>whether to go for a DSL</li><li>whether to use decision tables<br></li><li>...<br></li></ul>On a level in between, you have rule grouping:<br>
<ul><li>agenda groups</li>
<li>activation groups</li><li>rule flow</li><li>iterating rule engine activations<br></li><li>...<br></li></ul>Sometimes it's possible to delay decisions. For instance, you may not know whether it's better to have many rules in a few basic patterns with distinguising data embedded in them, or to have only a few rules, interpreting the equivalent data contained in static "parameter facts". Here, you could start out with a data representation, and you might decide to create rules later on. (See "templates" in Drools "Expert". And the ongoing discussion in an active thread.)<br>
<br>Rules as in Drools or similar systems are simple program structures; the essential part (left hand side) is just a boolean expression. A functionally equivalent engine for the basic CEs would be rather easy to write <i>if you use the naive approach</i> (i.e., not implement a Rete). Whether rule extension, as implemented in Drools, is a useful feature still remains to be seen.<br>
<br>Refactoring of rules is difficult, since they tend to interact in a highly intricate way, especially in production systems. Occasionally you can refactor by reducing the number of rules, replacing similar rules with a more general one that incorporates equivalent processing logic as data. For instance, if you have several rules implementing binary operations (think of the elementary algebraic or logic operators), you can factor them into a single BinOp rule where the actual operation is an attribute of the fact representing the operation, implemented - depending on your RBS - as a lambda, or a function pointer, or a method of an object of some subclass. (If this is too hazy, you can ask me for an example.)<br>
<br>-W<br><br><br><div class="gmail_quote">On Fri, Apr 9, 2010 at 1:41 PM, Franz Schwab <span dir="ltr"><<a href="mailto:franz.schwab@gmx.net" target="_blank">franz.schwab@gmx.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I forgot to post the links I already found:<br>
<a href="http://community.jboss.org/wiki/RefactoringRules" target="_blank">http://community.jboss.org/wiki/RefactoringRules</a><br>
<a href="http://vimeo.com/5157458" target="_blank">http://vimeo.com/5157458</a><br>
But this is very Eclipse-specific. The problem is:<br>
How do you change the design of a big rule based system if the demands<br>
to it changed? Which common practices do exist?<br>
What do you do with code smells, e.g. duplicate rules.<br>
The answers to the rest of your questions:<br>
<br>
Am 09.04.2010 07:02, schrieb Wolfgang Laun:<br>
<div>> On Fri, Apr 9, 2010 at 1:21 AM, Franz Schwab<<a href="mailto:franz.schwab@gmx.net" target="_blank">franz.schwab@gmx.net</a>> wrote:<br>
><br>
>> Hi,<br>
>> I'm a computer science student and am writing the related-work part for<br>
>> my diploma thesis and would be interested in (scientific) papers or<br>
>> information about refactoring or transformation possibilities which can<br>
>><br>
> Could you please be more specific? I have heard the term "refactoring"<br>
> in connection with certain modifications of a (Java) source program.<br>
> Is that the idea?<br>
><br>
> And "transformation" can be almost anything that produces a B from an A...<br>
><br>
</div><a href="http://en.wikipedia.org/wiki/Code_refactoring" target="_blank">http://en.wikipedia.org/wiki/Code_refactoring</a><br>
<div>><br>
>> be done with drools / jboss rules in order to improve design of a<br>
>> knowledge base<br>
>><br>
> How do you define "knowledge base"? Does this mean that you have a measure<br>
> for the quality of KBs?<br>
><br>
</div>Lets say a rule "based system" instead of "knowledge base" in the terms<br>
of drools.<br>
<div><br>
> or simply to delete bad smells.<br>
><br>
</div><a href="http://en.wikipedia.org/wiki/Code_smell" target="_blank">http://en.wikipedia.org/wiki/Code_smell</a><br>
<div>> ?? If I were inclined to be funny, I'd say you start by opening a window; but so<br>
> I just ask you to be more specific.<br>
><br>
</div>No, window is already opened :-)<br>
<br>
Thanks, Franz<br>
<div><div></div><div>> -W<br>
><br>
> I have to admit that I<br>
><br>
>> never worked with drools, as I said I just need that for the<br>
>> related-work part.<br>
>> Could you please give me some hints?<br>
>> Thanks,<br>
>> Franz<br>
>> _______________________________________________<br>
>> rules-dev mailing list<br>
>> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
>><br>
>><br>
> _______________________________________________<br>
> rules-dev mailing list<br>
> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br>