Bug 257112 - [DataBinding] Split org.eclipse.core.databinding into smaller plugins
Summary: [DataBinding] Split org.eclipse.core.databinding into smaller plugins
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
: 257786 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-01 13:21 EST by Boris Bokowski CLA
Modified: 2009-03-06 11:14 EST (History)
4 users (show)

See Also:
qualidafial: pmc_approved? (Mike_Wilson)


Attachments
Patch (1.41 MB, patch)
2009-03-04 13:14 EST, Matthew Hall CLA
no flags Details | Diff
mine (1.05 MB, patch)
2009-03-04 13:23 EST, Boris Bokowski CLA
no flags Details | Diff
new patch (541.84 KB, patch)
2009-03-04 13:45 EST, Boris Bokowski CLA
no flags Details | Diff
updated (666.46 KB, patch)
2009-03-04 13:59 EST, Boris Bokowski CLA
no flags Details | Diff
even better (821.75 KB, patch)
2009-03-04 18:04 EST, Boris Bokowski CLA
no flags Details | Diff
Even more betterer (832.82 KB, patch)
2009-03-04 18:35 EST, 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 Boris Bokowski CLA 2008-12-01 13:21:39 EST
Some clients are using just the observables part of the data binding plugin. Also, when running in constrained environments (e.g. SWT BE, GWT), some of the dependencies of the converter/validator code such as BigDecimal are not available (see bug 252290 for an example).

We should create a new smaller plug-in org.eclipse.core.databinding.observables which would have to be re-exported from org.eclipse.core.databinding for backwards compatibility.
Comment 1 Boris Bokowski CLA 2008-12-01 13:32:48 EST
McQ, +1?
Comment 2 Matthew Hall CLA 2008-12-01 13:37:19 EST
There are some compiled-in dependencies in core to com.ibm.icu (even though it is listed as an optional dependency).  In my test environments I always get runtime errors if these plugins are missing.  We should find a way to dynamically discover whether they are available and use them if so, or use the java.text formats otherwise.
Comment 3 Boris Bokowski CLA 2008-12-01 13:53:22 EST
(In reply to comment #2)
Do you get test failures, or compile errors?

This code was added to properly convert from BigDecimal objects to String values , working around the broken support in the Java class libraries prior to 1.5 (see bug 180392 comment 27).
Comment 4 Chris Aniszczyk CLA 2008-12-01 14:37:27 EST
very cool
Comment 5 Matthew Hall CLA 2008-12-01 21:23:49 EST
(In reply to comment #3)
> (In reply to comment #2)
> Do you get test failures, or compile errors?
> 
> This code was added to properly convert from BigDecimal objects to String
> values , working around the broken support in the Java class libraries prior to
> 1.5 (see bug 180392 comment 27).
> 

I get ClassNotFoundException at runtime, because core has one package from com.ibm.icu listed as an optional dependency, and another as a required dependency (I think com.ibm.icu.text)
Comment 6 Boris Bokowski CLA 2008-12-02 00:25:30 EST
(In reply to comment #5)
> I get ClassNotFoundException at runtime

You need the ICU4J replacement jar (look for "com.ibm.icu.base" on any Eclipse SDK build download page) which is 0.17 MB, or the full ICU4J. The optional dependency is optional because the replacement jar does not contain the referenced type(s).
Comment 7 Boris Bokowski CLA 2009-01-20 16:00:29 EST
I don't have enough time to do this for M5. Affects API so should be done before M6.
Comment 8 Matthew Hall CLA 2009-03-04 13:14:47 EST
Created attachment 127519 [details]
Patch
Comment 9 Boris Bokowski CLA 2009-03-04 13:23:43 EST
Created attachment 127520 [details]
mine
Comment 10 Boris Bokowski CLA 2009-03-04 13:45:31 EST
Created attachment 127525 [details]
new patch

I messed with CVS history (by copying files over to the new plug-in project). Can you load org.eclipse.core.databinding.observables from HEAD and then apply this patch?
Comment 11 Boris Bokowski CLA 2009-03-04 13:59:27 EST
Created attachment 127532 [details]
updated

Some minor tweaks
Comment 12 Matthew Hall CLA 2009-03-04 15:19:40 EST
IStatus is exposed as API in core.databinding, so we should re-export the equinox.common dependency
Comment 13 Boris Bokowski CLA 2009-03-04 15:53:42 EST
(In reply to comment #12)
> IStatus is exposed as API in core.databinding, so we should re-export the
> equinox.common dependency

No, we don't re-export in cases like this. The only good reason for re-exporting is when you split plug-ins - the old plug-in will have to re-export the pieces that got split off to maintain backwards compatibility.
Comment 14 Matthew Hall CLA 2009-03-04 16:21:39 EST
(In reply to comment #11)
> Created an attachment (id=127532)
> updated
> 
> Some minor tweaks

+1
Comment 15 Boris Bokowski CLA 2009-03-04 18:04:27 EST
Created attachment 127578 [details]
even better

This patch includes the changes for bug 267101 (split off properties). We will have to make a few more changes tomorrow when (hopefully) the webmaster will have renamed the directories for us.

The separation is looking good, but there is one remaining issue: BindingException is being used in databinding.core.beans - do you think we can throw some other exception instead if we cannot find a getter or setter method?
Comment 16 Matthew Hall CLA 2009-03-04 18:12:13 EST
I'm thinking either IllegalArgumentException or UnsupportedOperationException
Comment 17 Matthew Hall CLA 2009-03-04 18:35:11 EST
Created attachment 127579 [details]
Even more betterer

Using IllegalArgumentException instead of BindingException
Comment 18 Boris Bokowski CLA 2009-03-05 09:15:57 EST
(In reply to comment #16)
> I'm thinking either IllegalArgumentException or UnsupportedOperationException

Depends on when we throw the exception - if it happens eagerly, right when observables are created, IllegalArgumentException would be appropriate. On the other hand, if any of these can happen later, when calling getValue() or setValue(), we should be using UnsupportedOperationException.
Comment 19 Matthew Hall CLA 2009-03-05 09:58:55 EST
(In reply to comment #18)
> Depends on when we throw the exception - if it happens eagerly, right when
> observables are created, IllegalArgumentException would be appropriate. On the
> other hand, if any of these can happen later, when calling getValue() or
> setValue(), we should be using UnsupportedOperationException.

Eagerly--it is thrown in BeanPropertyHelper.getPropertyDescriptor() when a bean lacks the named property for a particular bean class.  The method is consulted before creating observables.

The latest patch already uses IllegalArgumentException.
Comment 20 Boris Bokowski CLA 2009-03-05 14:48:03 EST
*** Bug 257786 has been marked as a duplicate of this bug. ***
Comment 21 Boris Bokowski CLA 2009-03-05 14:48:56 EST
Changes are in HEAD. I have requested a test build.
Comment 22 Boris Bokowski CLA 2009-03-06 11:14:13 EST
Marking fixed. The test build worked.