<div id="mb_0">Hi,<br><br>Consider that I have 500 instances of
interface userI. Now, there are 3000 rules currently written based on a
combination of these instances.<br><br><span style="color: rgb(102, 102, 204);">if {</span><br style="color: rgb(102, 102, 204);">

<span style="color: rgb(102, 102, 204);">&nbsp;&nbsp;&nbsp;&nbsp; $a : userI (name = &quot;A&quot;)</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">&nbsp;&nbsp;&nbsp;&nbsp;  $b : userI (name = &quot;B&quot;)</span><br style="color: rgb(102, 102, 204);">


<span style="color: rgb(102, 102, 204);">}</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">then</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">

{
</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">&nbsp;//do some actions</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">}</span><br><br>How many tests are needed for a match in the RETE network for this rule?
<br><br>If I created 500 classes, one for each object, such as UserA implements userI and so on... my rule will look like:<br><br><span style="color: rgb(102, 102, 204);">if {</span><br style="color: rgb(102, 102, 204);">


<span style="color: rgb(102, 102, 204);">&nbsp;&nbsp;&nbsp;&nbsp; $a : UserA()</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
&nbsp;&nbsp;&nbsp;&nbsp;  $b : UserB()</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
}</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
then</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
{</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
&nbsp;//do some actions</span><br style="color: rgb(102, 102, 204);"><span style="color: rgb(102, 102, 204);">
}<br><br><span style="color: rgb(0, 0, 0);">Will this lead to better performance since there will only be one such instance of this object?<br><br>As for class-loading concerns, will there be a parsing/memory penalty to be paid for having 500 classes now instead of one?
<br><br>Thanks!<br style="color: rgb(102, 102, 204);"></span></span>
</div>