Community
Participate
Working Groups
Created attachment 81492 [details] ComputedList patch I've written a ComputedList class based on ComputedValue, which I am contributing to the DataBinding project. See attached patch.
Seeing that this patch is a derivative work of ComputedValue, I'm unsure of what should go in the authorship comments at the top of the file. I'll leave that to the committer to decide, should this patch be accepted into the project.
Thanks for the contribution! I am curious what your use case is for this. Would it help to have a more fine-grained variant of this, a computed list that manages dependencies for each element in the list instead of recomputing the whole list every time?
I have two use cases at present. Note in the graphs below that <>--- is used as the UML symbol for containment. First case: Order order <>--- List<Item> items List<IPart> parts Parts is the computed list, where every element is the corresponding element in items, transformed into an IPart. So yes, in this case, a derived list would be more appropriate. Second case: List<Item> items IAssignee assigneeSelection The computed list consists of all Items in items which are assigned to selectedAssignee. So in this case I'm just creating an array that filters over items. So I think that ComputedList makes more sense if you have multiple dependencies, and a DerivedList class would make more sense if your list is 1:1 with a single dependency.
Released patch with minor changes (copyright header, API spec, formatting).
Verified by code inspection in 3.4M5