[rules-users] Does the Rete Graph recognize associations independently?

Mark Proctor mproctor at codehaus.org
Mon Jul 30 08:39:06 EDT 2007


The engine has no way to know that one object is a field of another 
object. For this reason you should setup things relationally, using an 
object to relate the parent and child. Look at the Conways game of life 
example and the Neighbor class. You also then have the advantage that 
you can now exploit the cross product to drive the application.

Read this blog:
http://blog.athico.com/2007/06/declarative-relational-programming.html

Mark
Arjun Dhar wrote:
> Hi,
>  one doubt I've had while writing DRL scripts and also with others is:
>
> A {
>  B b
>  C c
>  D d
> };
>
> If The rules are to be Written over A, B, C
> Then should one assert B, C & D also? ---> Answer yes!
>
> Ok, now that we've asserted them, in the Rule if one uses:
> A.b; does the Rete graph recognize it as a node of A or B?
> I suspect it is 'A'
>
> Hence...
> I take a safe approach and write rules on B,C independently but then ensure 
> those objects are reverse associated with A. This increases the risk of objects 
> not being released for GC (depends on JVM) if not nullified (and breaking the 
> circular associations).
>
> So whats the best approach in designing objects for the Engine?
>
> Thanks,
> Arjun
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>   




More information about the rules-users mailing list