<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">The answer to whether this is a good approach is, "It depends." :)<br><br>Does the 10^4 and 10^5 figure mean there could be that many rules?&nbsp; If so, definitely do the data driven approach.<br><br>If not, will business folk (i.e. non technical) will be writing pricing rules?&nbsp; If so, do the rules based approach as data driven rules are generally less understandable by business types. (They're a bit more abstract and influenced by the structure of your data model.&nbsp; Business people should not have to deal with either abstraction or the implementation details of a data model.) <br><br>There's no reason why you can't do both, though.&nbsp; <br><br>--- On <b>Wed, 4/7/10, Bertrand Grottier <i>&lt;b_grottier@hotmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From:
 Bertrand Grottier &lt;b_grottier@hotmail.com&gt;<br>Subject: [rules-users] Facts or rules ?<br>To: rules-users@lists.jboss.org<br>Date: Wednesday, April 7, 2010, 9:23 AM<br><br><div id="yiv1286396095">

<style><!--
#yiv1286396095 .hmmessage P
{
margin:0px;padding:0px;}
#yiv1286396095 .hmmessage
{
font-size:10pt;font-family:Verdana;}
--></style>
Hello,<br><br>I am a newbie with business rules systems.<br><br>I would like to implement a component that "compute" the price of products. There can be a great number of potential prices (maybe 10^4 or 10^5).<br><br>My first idea was to create template rules, "feeded" by a database. In other words, the information about prices would be contained in the rules.<br><br>Eventually, I decided to create Prices objects, that are also inserted in the Knowledge session (Prices become facts). The rule engine just "matches" the appropriate price object with each product (there are other rules then to compute the final price).<br><br>Price<br>
{<br>
_productId ;<br>
_beginDate ;<br>
_endDate ;<br>
....<br>
_price ;<br>
}<br>
<br>
Product<br>
{<br>
_id ;<br>
_date ;<br>
...<br>
_<br>
}<br>
<br>Are my explanations clear enough ?<br><br>Is this a good approach or is it stupid ? Why ? What are the good practices ?<br><br>Thank you in advance for your help.<br><br>Benoît<br><br><br>                                               <br><hr>Envie de naviguer sur Internet sans laisser de trace? <a rel="nofollow" target="_blank" href="http://clk.atdmt.com/FRM/go/207186970/direct/01/">La solution avec Internet Explorer 8</a> 
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></blockquote></td></tr></table><br>