tags:

views:

504

answers:

2

I started to investigate beans binding and my head is starting to spin. There are so many options, but it's a central design decision that sounds hard to change. I have a set of interrelated POJOs that I want to edit with a GUI. What is my best option for a stable, simple deployment? If there's not one good solution, do these options play nice together?

Here are the current contenders:

Please share your experiences with these libraries. Especially if you tried one and switched to another.

A: 

We use the JGoodies Binding framework and it's pretty good. That's mainly with simple properties though - if you want to do anything more complex you do have to write a bit of glue code. Not sure how whether other frameworks would do that better.

It doesn't support things like nested properties though, I've heard that the binding in the Spring RCP project is better. I'd suggest investigating that first over JGoodies.

Phill Sacre
+3  A: 

I've used all of the above except JFace. Started with JGoodies, and found it to be a bit tough to use. BeansBinding was easier to understand, but it's support for list operations is pretty poor. Enter Glazed Lists. GL is one of the best open source libraries I've ever used. Recently, they added a PluggableList implementation that allows GlazedLists lists to be bound to list properties from POJOs using BeansBinding. The result is the best of both worlds.

We also frequently use the Calculations API (part of Glazed Lists) to compute list-wide properties, and bind the results (using BB) to POJOs, GUI widgets, etc... Adding a label that shows the number of elements in a list (or any other calculation) is crazy simple.

I will say that BB has a lot of room for improvement, and indeed, it has been forked to BetterBeansBinding - I'd recommend that you work with BBB moving forward if you can.

We have several applications using the combination of BB and GL (one of which is a very large, complex GUI app), and have been delighted with the results.

I do suggest that you take the time to play around with bindings before you really start using it. Shifting to a declarative programming style takes some practice, but once you've done it, the results are nearly miraculous. I suggest a minimum of 3 small, but complete projects so you can get your head around it (if you can introduce Presentation Model concepts into your design, that will also have huge payback down the road).

Kevin Day