Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "JFace Data Binding"

(Learning more...)
(Move "Bind" link to "Historical Documents" section)
(68 intermediate revisions by 13 users not shown)
Line 1: Line 1:
== Why JFace Data Binding? (code name: Krispy Kreme) ==
+
__NOTOC__
 +
JFace Data Binding is a multi-threaded set of abstractions that allow for automated validation and synchronization of values between objects.  This is commonly used for, but not limited to, the binding of user interface components to model attributes.  The core concepts behind the project are [[Observables]] and [[Binding | Bindings]].  We provide IObservable implementations for SWT,  JFace, and JavaBeans but the core is void of references to these in anticipation of implementations for other projects (e.g. EMF, Swing, etc.).
 +
{{JFace Data Binding}}
  
Developing line of business applications as Eclipse Rich Client Platform applications presents a number of unique challenges.
+
<table border="0"  width="100%" cellspacing="6">
 +
<tr>
 +
<td valign="top" width="33%">
 +
<h3>Tutorials & Presentations</h3>
 +
* [[/Getting started | Getting Started]]
 +
* [http://www.vogella.com/articles/EclipseDataBinding/article.html Tutorial]
 +
* [[/Snippets | Snippets]]
 +
* [[JFace Data Binding Introduction|High-Level Description of Data Binding]]
  
* How does one validate data entry when the number of possible interactions between validation rules rises proportional to the square of the number of data entry fields on an input form?
+
<h3>Concepts</h3>
 +
* [[/Observable|Observable]]: value, list, set, or map whose state changes can be observed
 +
* [[/Binding|Binding]]: keeps the state of two observables in sync, uni- or bidirectional
 +
* [[/Data_Binding_Context|Data Binding Context]]: a container for bindings
 +
* [[/Converter|Converter]]: used by a binding to convert values
 +
* [[/Validators|Validators]]: used by a binding to validate values
 +
* [[/Realm|Realm]]: serializes access to observables (every observable belongs to a realm)
 +
* [[/TrackedGetter|Tracked Getter]]: makes the system aware of observables that a piece of code depends on
 +
* [[/Master_Detail|Master-Detail]]: used when you want to bind to attributes of the currently selected object, rather than a fixed object
 +
</td>
 +
<td valign="top" width="33%">
  
* How does one avoid coding repetitive, dull, tedious, and error-prone SWT event handlers?
+
<h3>Miscellaneous</h3>
 +
* [[/FAQ | FAQ]]
 +
* [http://fire-change-event.blogspot.com/  fireChangeEvent() Blog]
 +
* [[/How to Contribute | How to Contribute]]
 +
* [[/Wiki Guidelines|Wiki Guidelines]]
 +
* [[/Conformance Tests|Conformance Tests]]
 +
* [[/EMF|Binding to EMF]]
 +
* [[/GWT|Binding to GWT (experimental work)]]
 +
* [[/DOM|Binding to DOM (experimental work)]]
 +
* [[/SSE|Binding to SSE (DOM, EMF, CSS) (experimental work)]]
 +
* [[/Rhino|Binding to Rhino (Javascript Scriptable Object) (experimental work)]]
 +
* [[/PojoBindable|Binding to Pojo (by using NOT BeansObservable) (experimental work)]]
 +
* [[/JSR303BeanJFaceDatabindingValidation|JFace Databinding Validation with JSR-303 (experimental work)]]
 +
</td>
 +
</tr>
 +
</table>
  
* How can one improve reuse of data-driven user interfaces?
+
== Contact Us ==
 +
The [http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform.jface JFace newsgroup] is the place for discussions and questions relating to JFace Data Binding. When posting please prefix the subject with "[DataBinding]" to allow us to easily find posts related to the project.
  
All of these concerns are improved using JFace Data Binding.
+
Design discussions and bugs are located on [https://bugs.eclipse.org/bugs/ Eclipse bugzilla] with a the values...
 +
; Classification : Eclipse
 +
; Product : Platform
 +
; Component : UI
  
=== How does this work? ===
+
Like posts to the newsgroup when logging bugs please prefix the summary with "[DataBinding]" to allow for easier identification.
  
Traditionally, database-driven line of business applications are organized into tiers:
+
== Getting Involved ==
 +
There are many ways to get involved with JFace Data Binding.  To find out how you can contribute see [[/How to Contribute|How to Contribute]].
  
* a database tier
+
== Historical Documents ==
* a business or domain model tier
+
* [https://admin.adobe.acrobat.com/_a300965365/p77464314/ JFace Data Binding Webinar] ''(The code in this presentation is slightly out of date - converters and validators are set up differently in the final 1.0 API.)''
* a presentation tier
+
* [[Media:Databinding.zip | Dave and Boris's EclipseCon 2007 long talk and slides]](Slightly out of date)
 +
* [[Media:Databinding.pdf | Dave Orme's EclipseCon 2006 Lightning Talk slides]] ''(This presentation is outdated. The concepts are still relevant though.)''
 +
* [[/Original Design | Original Design Document]]
 +
* [[/Scenarios | Scenarios Document]]
 +
* [[/The New Binding API|Bind]]: A prototype for a new and improved binding API, which was never finished
  
The communication paths between these tiers are organized along the routes that data flows within and among these tiers.
+
== Project Release Status ==
 +
JFace Data Binding 1.0 was released with Eclipse 3.3, [[Europa Simultaneous Release | Europa]].  The Eclipse 3.3.1 release (Europa Fall Maintenance Release) contains a number of [https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=%5BDataBinding%5D&classification=Eclipse&product=Platform&component=UI&target_milestone=3.3.1&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= bug fixes].
  
Recently, Hibernate, EJB3, and Rails technologies have emerged as a means of automating the data flow between the business tier and the database tier.
+
[[Category:Data Binding]][[Category:Platform UI]]
 
+
By analogy, just as Hibernate helps automate the data flow between the business tier and the database tier, JFace Data Binding helps automate the data flow betweeen the business tier and the presentation tier.  It does this via a simple update to the model-view-controller pattern that enables us to create a set of completely generic and reusable controllers between the business model objects and the view (or presentation) tier.
+
 
+
== JFace Data Binding from 4000 meters ==
+
 
+
Traditional object-oriented architectures use the model-view-controller pattern to persist changes in a user interface to a model.  This architecture can be visualized as follows:
+
 
+
[[Image:Mvc.png]]
+
 
+
This works the following way:
+
 
+
* The view observes (listens to) the model for changes and redraws itself when it detects a change.
+
* The controller observes (listens to) the view for change events.
+
* When the controller detcts an event that needs to cause a change, it is responsible for mutating the model, which implicitly refeshes the view because it is listening to the model for changes.
+
 
+
There are a few problems with this pattern:
+
 
+
* The view has to understand the model.
+
* The controller has to understand both the view and the model.
+
 
+
Data binding is a recognition that most of the time, Text widgets are bound to single properties of objects, a radio group has a java.util.List or a java.util.Set of choices and its selection is bound to a single property of an object, and so on.  Since we know that the data type in the business model tier has to match the data type in the GUI widget, we can build a generic mapping layer between POJOs and GUIs similar to the way Hibernate is a generic mapping layer between POJOs and databases.
+
 
+
In general, the architecture then looks like:
+
 
+
[[Image:Binding.png]]
+
 
+
The implementation is simple.  The generic controller represents data binding.  It listens to changes on both the model and on the GUI view.  When a change in a property occurs in the model, it is automatically copied to the GUI.  Similarly, when the user changes a value in the GUI, the change is automatically copied back to the model.
+
 
+
== Learning more... ==
+
 
+
'''Note:''' ''The JFace data binding framework is new in 3.2 but will not be public API for Eclipse 3.2.  This means that although you may use the APIs, you do so at your own risk because there might be breaking changes until the API is published in public packages.  We intend to publish the APIs in the next version of Eclipse and are interested in feedback from early adopters.  We will try to minimize breaking changes, but ultimately there are no guarantees whatsoever. To isolate yourself from breakage by new versions of Eclipse, you might want to consider copying the jars to your own project as opposed to using the data binding plug-in directly.
+
 
+
For comments, design feed back, and bug reports, please enter [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&version=3.2&component=UI&rep_platform=All&op_sys=All&priority=P3&bug_severity=normal&target_milestone=---&bug_status=NEW&assigned_to=Platform-UI-Inbox%40eclipse.org&qa_contact=&cc=&bug_file_loc=http%3A%2F%2F&short_desc=%5BDataBinding%5D&comment=&commentprivacy=0&keywords=&dependson=&blocked=&maketemplate=Remember%20values%20as%20bookmarkable%20template&form_name=enter_bug bugs against Platform/UI] using <nowiki>[DataBinding]</nowiki> in the summary.''
+
 
+
* [[Data Binding HOWTO]] Document
+
* [[Image:Databinding.pdf|Dave Orme's EclipseCon 2006 Lightning Talk slides]]
+
* [[JFace Data Binding TODO]] -- Current limitations we'd like to fix and would appreciate help with from the community
+
* [[JFace Data Binding Design]] Document
+
* [[JFace Data Binding Scenarios]] Document
+

Revision as of 14:14, 23 July 2019

JFace Data Binding is a multi-threaded set of abstractions that allow for automated validation and synchronization of values between objects. This is commonly used for, but not limited to, the binding of user interface components to model attributes. The core concepts behind the project are Observables and Bindings. We provide IObservable implementations for SWT, JFace, and JavaBeans but the core is void of references to these in anticipation of implementations for other projects (e.g. EMF, Swing, etc.).

JFace Data Binding
Home
How to Contribute
FAQ
Snippets
Concepts
Binding
Converter
Observable
Realm

Tutorials & Presentations

Concepts

  • Observable: value, list, set, or map whose state changes can be observed
  • Binding: keeps the state of two observables in sync, uni- or bidirectional
  • Data Binding Context: a container for bindings
  • Converter: used by a binding to convert values
  • Validators: used by a binding to validate values
  • Realm: serializes access to observables (every observable belongs to a realm)
  • Tracked Getter: makes the system aware of observables that a piece of code depends on
  • Master-Detail: used when you want to bind to attributes of the currently selected object, rather than a fixed object

Miscellaneous

Contact Us

The JFace newsgroup is the place for discussions and questions relating to JFace Data Binding. When posting please prefix the subject with "[DataBinding]" to allow us to easily find posts related to the project.

Design discussions and bugs are located on Eclipse bugzilla with a the values...

Classification 
Eclipse
Product 
Platform
Component 
UI

Like posts to the newsgroup when logging bugs please prefix the summary with "[DataBinding]" to allow for easier identification.

Getting Involved

There are many ways to get involved with JFace Data Binding. To find out how you can contribute see How to Contribute.

Historical Documents

Project Release Status

JFace Data Binding 1.0 was released with Eclipse 3.3, Europa. The Eclipse 3.3.1 release (Europa Fall Maintenance Release) contains a number of bug fixes.

Back to the top