Tuesday, October 17, 2006

Uber Factories and Project Refactoring

It would be difficult to try to sum up what has happened in Data Binding up until this point. So I thought I'd highlight a few changes/discussions that have occurred recently. In case you don't know we're on the road to the 1.0 release. One area that we're focusing on is API. I'll do my best to point out changes in the API.


bug 147563 - [DataBinding] Need a standard factory for data binding contexts

API Changes

"Those who already smoked the weed of the Überfactory and can't give up are advised to roll their own factories, or move to stronger stuff like e.g. AOP.""
- comment 75

If you are familiar with the Eclipse 3.2 version of Data Binding you might be familiar with the "Uber factories" that were used to create IObservables and Bindings. The factories, IBindingFactory and IObservableFactory, have been deprecated as we decided to keep the API simple and expressive in order to allow for transparency, simpler debugging, and better documentation. Currently there is SWT support using the new approach but we haven't moved the JFace support to the new API yet. For examples of the approach see SWTObservables and BeansObservables. Also, before the 1.0 release the static factory methods on SWTObservables will be changed from having a "get" prefix to an "observe" prefix.


bug 153630 - [DataBinding] Extract SWT specific code from JFace databinding into its own bundle

As of 20061004 what was org.eclipse.jface.databinding has been broken out into 3 separate plug-ins. The core framework no longer has SWT dependencies. The projects and their dependencies are as follows:

org.eclipse.jface.databinding "core data binding framework"
class library: J2ME Foundation 1.0
dependencies:
org.eclipse.equinox.common

org.eclipse.jface.databinding.ui "binding to SWT and JFace"
class library: J2ME Foundation 1.0
dependencies:
org.eclipse.jface.databinding
org.eclipse.equinox.common
org.eclipse.jface

org.eclipse.jface.databinding.beans "binding to Java beans"
class library: J2SE 1.4
dependencies:
org.eclipse.jface.databinding
org.eclipse.equinox.common

Spreadsheet Example

Boris has been working on a Spreadsheet implemented using Data Binding. It's an interesting example that uses ComputedValue in case you'd like to see it in action.

bug 116920 - [DataBinding] need to handle model change events which don't happen in the UI thread

It looks like progress is being made on the concurrency front. If you have any input/concerns on concurrency in the framework please add them to the bug. The issue is that the framework is not thread safe and if possible we'd like it to be for the 1.0 release.

We have a FAQ

A FAQ has been started on Eclipsepedia.

No comments: