Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for property reactivity #166

Open
a046 opened this issue Sep 26, 2018 · 2 comments
Open

Add support for property reactivity #166

a046 opened this issue Sep 26, 2018 · 2 comments

Comments

@a046
Copy link
Contributor

a046 commented Sep 26, 2018

As facts in NRules are objects. when updating a fact with many fields, it appears that all conditions related to that object must be re-evaluated even if only one field has changed. This makes some of the benefits of the RETE algorithm redundant if being used with a ruleset where the rule conditions are primarily for a single type of object.

It seems some other OO rules engines support field level updating to improve performance in this case, for example: https://docs.jboss.org/drools/release/7.0.0.Final/drools-docs/html_single/index.html#_fine_grained_property_change_listeners

This article also suggests Jess and Clips COOL also (can) work this way: http://blog.athico.com/2012/01/fine-grained-property-change-listeners.html

Are there plans for supporting something similar in NRules? If not, am I possibly doing something wrong - e.g. maybe constructing my model wrong if my rules' conditions are primarily for a single type of object?

@snikolayev
Copy link
Member

@a046 I thought about it, and was thinking to add at some point. Right now, agenda filters, particularly OnChange filter is as close as you can get to that behavior.
I think this is a great feature request.

@snikolayev snikolayev changed the title Plans to support property reactivity? Add support for property reactivity Sep 27, 2018
@a046
Copy link
Contributor Author

a046 commented Sep 29, 2018

Awesome!

I guess agenda filters will handle the recursion problem, but not the performance side?

Have you thought about how it may be implemented? Maybe with a new update method with a string for changed property, or hooking onto INotifyPropertyChanged of facts if they implement it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants