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"

m (Learning more...)
(replaced the main page)
Line 1: Line 1:
== Why JFace Data Binding? (code name: Krispy Kreme) ==
+
'''THIS PAGE IS UNDER CONSTRUCTION'''
  
Developing line of business applications as Eclipse Rich Client Platform applications presents a number of unique challenges.
+
JFace Data Binding is a 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.  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.).
  
* 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?
+
== Articles ==
 +
=== Requirements and Design ===
 +
* [[JFace Data Binding Introduction]]
 +
* [[JFace Data Binding Design]] Document
 +
* [[JFace Data Binding Scenarios]] Document
  
* How does one avoid coding repetitive, dull, tedious, and error-prone SWT event handlers?
+
=== Tutorials & Presentations ===
 +
* [[Data Binding HOWTO]] Document
 +
* [[Image:Databinding.pdf|Dave Orme's EclipseCon 2006 Lightning Talk slides]]
 +
* [https://admin.adobe.acrobat.com/_a300965365/p77464314/ JFace Data Binding Webinar]
  
* How can one improve reuse of data-driven user interfaces?
+
=== Miscellaneous ===
 +
* [[JFace Data Binding FAQ]]
 +
* [[JFace Data Binding TODO]] -- Current limitations we'd like to fix and would appreciate help with from the community
  
All of these concerns are improved using JFace Data Binding.
+
== Contact Us ==
 +
The [http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform Platform 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.
  
=== How does this work? ===
+
Design discussions and bugs are located on [https://bugs.eclipse.org/bugs/ Eclipse bugzilla] with a the values...
 +
; Classification : Eclipse
 +
; Product : Platform
 +
; Component : UI
  
Traditionally, database-driven line of business applications are organized into tiers:
+
Like posts to the newsgroup when logging bugs please prefix the summary with "[DataBinding]" to allow for easier identification.
  
* a database tier
+
== Getting Involved ==
* a business or domain model tier
+
There are many ways to get involved with JFace Data Binding...
* a presentation tier
+
* Answer questions on newsgroup - we try to be prompt and responsive on the [http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform newsgroup] but there's always room for improvement.  If you know the answer to a query feel free to answer.
 +
* Write patches for new or existing bugs - When logging a bug if a patch is included it will increase the likelihood and speed at which the fix is made.  To make a great impression, attach a test as well.
 +
* Write documentation or tutorials - A project can never have too much documentation.  We're in need of updates for the wiki and we're looking for more tutorials.
 +
* Let us know how you feel - Feedback, whether positive or negative, is always appreciated.  This can be done via the newsgroup, existing bugs, or plan items in bugzilla.
  
The communication paths between these tiers are organized along the routes that data flows within and among these tiers.
+
== Project Status ==
 
+
JFace Data Binding 1.0 will be released with Eclipse 3.3, [[Europa Simultaneous Release | Europa]].  We have a few [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+M6&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=api&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&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= API additions or changes] that are scheduled to occur before 3.3M6 is released.
Recently, Hibernate, EJB3, and Rails technologies have emerged as a means of automating the data flow between the business tier and the database tier.
+
 
+
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 detects an event that needs to cause a change, it is responsible for mutating the model, which implicitly refeshes the view because the view 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 simpleThe 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.
+
 
+
To make this concrete, let's look at an example:
+
 
+
Suppose the model object is an Integer property of an Employee object called "numberOfYearsWithFirm".  This property is to be bound to an SWT Text control.  Then:
+
 
+
* The data type of the model object is "int".
+
* The data type of the UI is "String" (the data type of the text property of the Text).
+
 
+
The controller simply listens to the model for changes in the "numberOfYearsWithFirm" property.  Similarly, it listens to the SWT Text object for changes the user makes in the UI.
+
 
+
If the user changes the UI or the underlying model object changes, that change is copied to the other side, automatically applying any validation and/or data type conversion rules that are necessary to make the whole thing work.
+
 
+
For example, if the user changes the SWT Text object, the new String value is validated that it can be converted to an "int", the value is then converted to an "int", and the new integer value is then set in the model object.
+
 
+
== 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.''
+
 
+
* Boris Bokowski and Dave Orme's EclipseCon 2007 presentation: http://eclipsezilla.eclipsecon.org/show_bug.cgi?id=3743  (Code examples and slide are attachments to the presentation)
+
* [[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
+
* [[JFace Data Binding FAQ]]
+

Revision as of 22:58, 12 March 2007

THIS PAGE IS UNDER CONSTRUCTION

JFace Data Binding is a 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. 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.).

Articles

Requirements and Design

Tutorials & Presentations

Miscellaneous

Contact Us

The Platform 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...

  • Answer questions on newsgroup - we try to be prompt and responsive on the newsgroup but there's always room for improvement. If you know the answer to a query feel free to answer.
  • Write patches for new or existing bugs - When logging a bug if a patch is included it will increase the likelihood and speed at which the fix is made. To make a great impression, attach a test as well.
  • Write documentation or tutorials - A project can never have too much documentation. We're in need of updates for the wiki and we're looking for more tutorials.
  • Let us know how you feel - Feedback, whether positive or negative, is always appreciated. This can be done via the newsgroup, existing bugs, or plan items in bugzilla.

Project Status

JFace Data Binding 1.0 will be released with Eclipse 3.3, Europa. We have a few API additions or changes that are scheduled to occur before 3.3M6 is released.

Back to the top