I think Steven Goncalo wrote: > I have a few questions about how shadow facts and the "extends" keyword > interact > > If I define templates Atag and APLUStag, where APLUStag extends Atag, > can I define a shadow-fact for APLUStag using a java APLUSclass without > also defining an Aclass to shadow Atag? The syntax would seem to allow > this, but I am not sure how well Jess would handle having some Atag's > shadowed and others not shadowed.
Jess is actually fine with this: shadow templates can extend non-shadow ones, and vice-versa. > If I must create a java Aclass, will jess require APLUSclass to > extend Aclass, or is it sufficient to have a compatible properties > interface? Inheritance is not required. > The reason I am considering such an odd thing, is that I have a large > number of Atag facts that get saved and restored between runs using > save-facts and load-facts. My first few experiments resulted in a set of > reloaded facts that had OBJECT set to nil with no associated java beans. > Is a fact with OBJECT set to nil functionally the same as a non-shadowed > fact, or is it an abomination that will lead to undefined behavior? If a template is defined as a shadow template, and you use it to assert non-shadow facts, then the default slot values will be weird; things won't work right unless when you assert the fact you specify a value for each slot. I believe in your save/load scenario, this should happen automatically. > Is there a standard way to save/restore a selected set of shadow > facts (short of restoring the entire engine contents with > bsave/bload)? No. > Let me throw in one more question related to shadow-facts. The > description of defclass says "Note that it is an error for a given Java > object to be installed in more than one definstance at a time." I can > see bad things happening with the same object installed twice in the > same engine, but I suspect it might be safe to install the same object > once in each of two separate engines. If I have more than one instance > of the Rete engine running within my application, can I create a single > java object and definstance it into more than one engine? Yes. --------------------------------------------------------- Ernest Friedman-Hill Advanced Software 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] --------------------------------------------------------------------
