Ernest Friedman-Hill
Tue, 03 Nov 2009 08:19:18 -0800
The basic idea of what you've shown below should work fine; is there a specific problem with it that I can help you with?
On Nov 3, 2009, at 8:40 AM, Joao Carlos Mourao wrote:
Hello,I'm having some problems to use interfaces in Jess. I had make a searchin the mailing list, and although there were some messages over thetopic, i still was not able to really understand how the process works. The problem is basic: I have a set of classes C, and a respective set ofinterfaces I. I'm creating objects of classes C and adding to theworking memory. I would like use the interfaces I to access this objects(in Jess). How? Solutions: a) should i declare the classes, and work with the classes, leaving the interfaces behind; b) declare the interfaces as (deftemplate I_name (declare (from-class C_name)); Doesn't work, because when i try to match in a rule, I_name is not the same as C_name, then Jess don't match c) have a combination of declarations of interfaces and classes, like Russ did in a previous message "r.eval("(defclass IInterface1 IInterface1)"); r.eval("(defclass IInterface2 IInterface2 extends IInterface1)"); r.eval("(defclass AbstractClassA AbstractClassA extends IInterface2)");r.eval("(defclass ClassB ClassB extends AbstractClassA)"); r.eval("(defclass ClassC ClassC extends AbstractClassA)"); r.eval("(defclass ClassD ClassD extends IInterface2)");", which i have tried but haven't worked. Any ideas? Joao -unclassified ------------------------------------------------------------------------------------------------------------ Disclaimer:If you are not the intended recipient of this email, please notify the sender and delete it. Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden. Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s). Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.------------------------------------------------------------------------------------------------------------ <joao.mourao.vcf>
--------------------------------------------------------- Ernest Friedman-Hill Informatics & Decision Sciences Phone: (925) 294-2154 Sandia National Labs PO Box 969, MS 9012 ejfr...@sandia.gov Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov. --------------------------------------------------------------------