Closed dazinator closed 7 years ago
Im closing this because it remains a pipedream that I won't have time to work on
Also there is nothing wrong with the current mechanism of explicitly wiring up dependencies.
Just want to add:
When your rule declares InputProperties and AffectedProperties these are automatically considered dependencies. Then there is no need to add an explicit Dependency rule.
See code for Dependency rule:
public Dependency(Csla.Core.IPropertyInfo primaryProperty,
params Csla.Core.IPropertyInfo[] dependencyProperty)
: base(primaryProperty)
{
AffectedProperties.AddRange(dependencyProperty);
}
Good point! :-)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I was working with knockoutjs quite recently, which has the concept of computed functions - basically an ordinary function, but knockoutjs tracks which "observable" properties that function accesses when the function runs, then it sets up dependencies automatically, so that when those properties change, the function is re-executed.
This is quite similar in nature to CSLA. However in CSLA, you configure the dependencies explicitly, like this:
So the idea / proposal I was thinking about would be to do something like this:
In the above example, the idea would be, you'd no longer need to add Dependency rules explicitly for the lamda rule, CLSA would instead discover the dependent properties that the lambda expression observes in its body, and set up the dependencies automatically.
Would cause the lamda to execute whenever that property changed.
As to how possible this is I don't know..