« WS-ActiveGroovyFX Script.Net 2.0! | Main | Groovy and Swing Bindings: Change is Inevitable »

JSR-295 Binding Builder for Groovy

In response to my recent post about swing data binding and groovy I am pleased to let everyone know that I've been doing more than making snarky remarks about <Foo>FX and causing grief constructive discussion on the developers list. I've actually implemented something. Ultimately for a first pass I decided to wrap the 0.5 release of the beansbinding project for JSR-295. Well, at least as much as I've found demo code for online. It's kind of weird writing code for a JSR that has released working code but hasn't posted a public review of their API. I'm talking about Beans Binding not Groovy. (Oops, there goes the snarky remarks again, of course released working code preceeded the Groovy JSR.)

In working with the code for beans bindings I see why they decided to go with EL notation in the naming of the source and target properties. It has to do with the ability to stack up the various bean references and make a 'property path' of observable beans, where if a change is observed in any of the beans along the path an update will be triggered. While my approach was a little more simplistic than this, the JSR approach has the advantage of a simplified mental model for properties, you don't need to be a swing wizard knowledgeable about all of the events, or the model objects that actually fire the events. More like a data modeling DSL and less like a Swing API in the end.

Anyway, to get at it you are going to have to download the source from svn and build the beansbinding module. It's not soup enough to make release jars IMHO, perhaps closer to Groovy 1.1 if GROOVY-1884 gets the blessing of the despots. In fact the current demo relies on the @BoundProperty patch I just mentioned. It may also get rolled into the SwingXBuilder project from Google's Summer of Code. For a code sample you can look in the Groovy Wiki.

In a later blog I will go into some of the design decisions, but I'll just leave it by saying that I think the nested nature of the JSR-295 API makes it look and work great in a Groovy builder.

About

This page contains a single entry from the blog posted on May 21, 2007 7:54 PM.

The previous post in this blog was WS-ActiveGroovyFX Script.Net 2.0!.

The next post in this blog is Groovy and Swing Bindings: Change is Inevitable.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33