Your opinion matters! Please fill in the InfoQ Survey!

Beans Binding Update: Scott Violet on JSR 295

| by Rob Thornton Follow 0 Followers on Feb 05, 2007. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

Scott Violet has written an update on the status of JSR 295 (Beans Binding). While externally, there has been little happening since last summer, the expert group has made substantial progress and he posts a small demo and some code.

Violet warns that they are not done and his example will likely change before they finish, but he posts some code showing how to bind a List of Bugs to a JTable. Here is an example of the binding code:

context = new BindingContext();

List bugs = ...;
Binding tableBinding = context.addBinding(
bugs, // Source for the binding, the List of bugs in this case.
null, // Expression, relative to the source, used in obtaining the property.
// For this example it's null, meaning use bugs as is.
bugTable, // Target of the binding, a JTable in this case.
"elements"); // The property of the target to bind to.

  "${ID}", // Expression evaluated relative to each Bug.
// In this case, it's treated as bug.getID().
null, // Target value (I'm not going to get into this parameter now)
TableColumnParameter, 0); // Specifies the binding applies to the first column

One of the features of binding which has drawn numerous questions in the comments of his post is the use of the JSP Expresion Language to specify the source of a binding. Violet describes why they chose EL:

Until java has first class support for properties, some syntax will need to be adopted. EL was created for needs similar to beans binding and is a natural fit. No point in inventing a new duplicate syntax.

Violet says he is working on making the source available, and some of the commenters hope that he will open a JSR project on to get more feedback from the community.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Cooperation between Sun and by Ulrich Weber

There's something awfully wrong within the Java-community It seems that one only person is working on JSR 295. Microsoft has databinding since 2000 for .NET. Why does Sun's Scott Violett not cooperate with the Eclipse-team doing almost the same technology? Look at the API-proposition from and the one from Sun. That's essentially the same thing.

How many years do we have to wait until JSR 295 ships? Another 2 or 3 years? The Eclipse-databinding is ready to ship right now. You should make another interview with the Eclipse-team. And off-course you should ask why there's no cooperation betwen Sun and the Eclipse-team.

Re: Cooperation between Sun and by Catalin Strimbei

Java world already has many binding frameworks (JGoodies bindings, Oracle ADF with or without BC, Eclipse JFace has its own binding mechanism). The problem reside in standardization and general IDE declarative support.

Wow still using Strings by Jeppe Cramon

It's beyond me that they still use strings to represent the property binding, when you have a stongly typed language where the compiler and IDE tools (code completion, refactoring) can help. String are too fragile, in 2007 we should be able to do it smarter...

Re: Wow still using Strings by Rafael de F. Ferreira

Carlos Villela's "static reflection" suggestion would be a big help in this regard.

Re: Wow still using Strings by Gerald Loeffler

It's beyond me that they still use strings to represent the property binding

so what would you suggest, apart from extending the language?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

5 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you