<br>&nbsp;&nbsp; Interesting. I had never tried it without the &quot;.class&quot; static field in the class name. I need to investigate this a further but I think what is happening behind the scenes is that since you are using nested accessors (option.class), it is getting transparently re-written into an inline eval(). This should not be a big deal, since you don&#39;t have (I guess) too many classes and indexing/hashing would not help you that much either. So I guess performance is probably the same, but as you said, more readable.<br>
<br>&nbsp;&nbsp; Question: what is the actual type of your &quot;option&quot; field? I mean, what class does getOption() returns? Object?<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/5/24 Barry Kaplan &lt;<a href="mailto:groups1@memelet.com">groups1@memelet.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Edson, I do not assert the Instruments, on the Positions which contains<br>
multiple Instruments. I an trying to match Option Positions (ie, Positions<br>
that contain one or more Option legs).<br>
<br>
What I did was...<br>
<div class="Ih2E3d"><br>
when<br>
 &nbsp; &nbsp;position : Position(option : instrument, option.class ==<br>
</div>OptionInstrument)<br>
<br>
...and this works correctly. Is the above more or less efficient than using<br>
eval or the from-clause? It certainly is easier to read.<br>
<br>
thanks!<br>
<br>
-barry<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Matching-on-instanceof-without-eval--tp17425953p17453068.html" target="_blank">http://www.nabble.com/Matching-on-instanceof-without-eval--tp17425953p17453068.html</a><br>

</font><div><div></div><div class="Wj3C7c">Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto: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></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>