Bug 207838 - [DataBinding] ComputedList contribution
Summary: [DataBinding] ComputedList contribution
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-10-29 15:25 EDT by Matthew Hall CLA
Modified: 2008-03-28 16:46 EDT (History)
2 users (show)

See Also:


Attachments
ComputedList patch (6.92 KB, patch)
2007-10-29 15:25 EDT, Matthew Hall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Hall CLA 2007-10-29 15:25:34 EDT
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.
Comment 1 Matthew Hall CLA 2007-10-29 15:28:08 EDT
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.
Comment 2 Boris Bokowski CLA 2007-10-30 11:13:51 EDT
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?
Comment 3 Matthew Hall CLA 2007-10-30 12:41:35 EDT
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.
Comment 4 Boris Bokowski CLA 2007-12-02 14:06:41 EST
Released patch with minor changes (copyright header, API spec, formatting).
Comment 5 Matthew Hall CLA 2008-03-28 16:46:33 EDT
Verified by code inspection in 3.4M5