Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 122568

Summary: [DataBinding] Bind-time Type Checking is Inflexible
Product: [Eclipse Project] Platform Reporter: Scott Delap <scott>
Component: UIAssignee: Dave Orme <djo>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: djo
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Scott Delap CLA 2006-01-03 17:24:59 EST
I'm currently attempting to build some reusable logic that builds nested trees of IUpdatableValues to easily bind to leaves deep in a tree of objects (patch on that later).  So you wind up with String property descriptions like of "foo.bar.name" that binds to the getName() method of an object returned by getBar() on a parent object returned by getFoo() on a root object. The issue with this is that the anonymous IUpdatableFactory in the DataBindingContext.registerFactories() method expects a type to be specified.  I would argue that in most cases the objects being bound to don't exist until after bind time.  This is especially true if your root object is really an IUpdatableValue serving as a selection holder.  In such a case you could be binding to a whole tree of "thin air" until the selection is populated.  I'm guessing the argument for specific types is that validators and converters need to be looked up.  I would counter that these could be lazily retrieved when actual object instances exist to convert.  

Further, I think there are times the very values you are attempting to bind to might be polymorphic in nature.  In this case the converters would have to be looked up dynamically anyway.  For example ... say you have a collection of objects mapped to a table.  Each object has a getType() method that returns type  Object.  The concrete class being returned may vary.  You would need a converter to create a value to represent this object in a cell of the table.  In this case the type itself is polymorphic and a converter can't simply be retrieved once.
Comment 1 Dave Orme CLA 2006-01-06 16:11:15 EST
Bug 116349 has really morphed into a discussion about this bug.  Since all the contextual discussion is in that bug, I'm marking this a dupe of 116349.


*** This bug has been marked as a duplicate of 116349 ***