On Mon, Mar 1, 2010 at 9:08 AM, Wolfgang Laun <[email protected]>wrote:

>  (The scope of each rule and the scope surrounding all rules result in
> distinct evaluation contexts. The inheritance rule of block structured
> languages does not apply here.)  The rule would have to be written to
> achieve a local binding, within the LHS, e.g.
>
>   (UserModel( OBJECT ?objUserModel ))
>   (test (> (call ?objUserModel getExpertise "command") 2)
>
>
Thanks that was really useful. I often make this scoping error.


> This will also take care of the notification problem, provided you do
> proper notification for all updates of UserModel objects, especially those
> that change the Map you most likely have.
>
>
It seems to me that any notification of update works. i.e. I don't have to
notify that the actual map used in my getExpertise method changed (which was
an unnecessary overhead). Even notifying for a property change of a boolean
variable (say, modelUpdated) works.


> As to "design", you'll have to realize that eval results in poorer
> efficiency since the power of the Rete engine is not put to full use.
> Whether this is critical or not depends on the number of UserModel facts you
> have, how frequently they change, etc.
>
> I understand. Sounds like a limitation of my design.
However, most systems are quite dynamic and in our case we have different
tasks undertaken in one system, they require different knowledge which comes
from various java modules. Unless I use something like dynamically defined
JavaBeans for the classes that have this information, I don't see other ways
forward.  Perhaps others have better design on this.

Cheers,
Manolis

Reply via email to