RSS

Missings in GWT – Property Binding

25 Sep

Property Binding

As I mentioned above, one the first things I found missing in GWT was property binding. If you don’t know, property binding is a way of making state changes in one representation of data show up in another representation of the same data. This is commonly done in GUI code that uses the venerable MVC pattern. For example, say you had data that represented the personal information of somebody. That data would include stuff like their first, middle, and last names, street address, city, state or region, and postal code.

In MVC, you’d have a model, an object that captured just this information. A simple Person model might look like this:

public class Person
{
   public String firstName;
   public String middleName;
   public String lastName;
   public String address;
   public String city;
   public String region;
   public String postalCode;
}

You’d also have a GUI form that contained text controls for each one of these fields. In most GUI frameworks, including GWT, each of these controls (or widgets, in GWT terminology) contains a copy of that same data. A lot of GUI code is written that copies code from one to the other. Property binding is way to automate (some) of that boilerplate code and automatically copy the data from the first name widget to the Person.firstName field whenever the user enters a new value.

FYI.. property binding libraries

Gwittr is a project (hosted on Google code) that includes property binding support.

Metawidget is another project with property binding support.

gwtx is to provide drop in support for an extended set of the of the standard Java library classes on top of what is provided by the GWT distribution provided by Google.

Advertisements
 
Leave a comment

Posted by on September 25, 2008 in GWT-TIPS

 

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: