Well, it looks like the root of all my previous problems is that some
properties of my definstanced objects can be null (for example, initially a
user may not have chosen a command, or a medical order might not yet exist,
etc...).

So, as I understood, instead of doing something like:

(Defrule rule1
     (myObject
         (user ?x & :(eq "Alex" (get ?x name)))
    =>
    ...

I will rather do:

(defrule rule2
   (myObject (user ?x)))
   (User (OBJECT ?x) (name "Alex"))
   =>
    ...

And this will have the added benefit of working if the value of "name"
changes (in rule1, if name changes the rule does not get evaluated again,
only if user changes, whereas in rule2, if name changes and user is dynamic
of course, the rule get evaluated again).

So, this leads to changing a little the way I was thinking of using
definstance, etc... (this is normal as all systems have some kind of "most
optimum" or "most elegant" way of doing things).

Instead of having one object per user session that is definstanced, I think
I will end up having most of my objects that are relevant to the rule engine
definstanced, and some of them (those where properties change during the
lifetime of the object) will be dynamic.

Ok, so would it be a correct way of doing things to do the definstance in
the constructor of those classes and undefinstance in the finalize of those
classes? Obviously this would assume that the constructor of those
particular classes have the necessary parameters to avoid having some
important properties as null upond definstance.

Is this the correct direction?

Alex
-- 
Alexander Lamb 
Groupe Serveurs Applicatifs
Division d'Informatique Midicale
Htpitaux Universitaires de Genhve
21 rue Micheli-du-Crest
CH-1211 Genhve 4 / Switzerland
Tel: +41-22 372.48.46 Fax: +41-22 382.86.80
[EMAIL PROTECTED] / http://www.hcuge.ch

--------------------------------------------------------------------
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