I think Eric Jain wrote:
> I have some Java objects that make heavy use of Collection classes,
> especially java.util.List. I also have a lot of rules that need to test
> the size of a collection, or whether a collection contains a specific
> item.

The best way to do this is using explicit function calls. Because many
collections change their hashCode() values whenever their contents
change, they make lousy slot values.

> 
> Looking through the documentation, it seems that Jess only has direct
> support for arrays. Correct?

Yes.

> 
> Another problem is how do get Jess to automatically detect changes in
> collections. For example, the following statement should be able to
> trigger rules:
> 
>   entry.getNames().add("Test")
> 
> But where do I fire the property change event? Do I need to implement my
> own List class, and register it with Jess? Any suggestions for dealing
> with this issue?

These are all tricky and hard questions. I'd like to address this
general issue in Charlemagne (the next major Jess release) but I
currently don't have a design for how this would work. It's much
harder than you might think. Ideas are welcome (not just "Jess should
perform such-and-such magic" kind of ideas, but implementation ideas,
especially.) 

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to