Why Databinding Sucks…

Back from my holiday to sunny Lanzarote and still wandering around in sandals hoping London starts to warm up.

But back to business…

A recent theme for me is: ‘time saving’ frameworks, wasting my time. The Rails movement has had great success with the prescriptive data layer and recently Microsoft Atlas has jumped on the drag and drop AJAX bandwagon. I’ve used many others but Data Binding is the greatest of these bastions of pain wrapped in hope.

It always starts the same. Flashy Data-Binding demo; click, click, click and your DB table is a HTML table… WOW that’s great. So you try it out and hey-presto the demo works for you too… WOW that’s great. So you start building strongly typed dataset or transfer objects so that the click, click, click bit still works. And hey, now you have a handy way of structuring your data. You’ve got 2 copies of your data structure but that’s OK, you still have a warm fuzzy feeling from the first WOW.

So now you start binding your table. But real world tables aren’t like in the demo. You need custom formatting so you learn the magic binding syntax great but now you have procedural code in your mark up… Darn. You need more that alternating colors, that’s tricky… Darn. You need complex content in a cell so you need the ‘more generic’ template column but then getting hold of the contained controls is fiddly …Darn. You want to light the rows up using CSS alone so you finally have to fall back on the ‘more generic’ Repeater. But hey you can’t expect a framework to do everything right? But now you start realizing that it’s been a long time since the first WOW and your deep into ‘Darn’ territory.

Cut to a few weeks later …

Everything is difficult, you can’t find where things are done, you’ve used so many hacks to get around the foibles and inconsistencies of the Data-Binding framework that no two pages work quite the same. You’re fearful of touching anything in case it blows up. Even having giving up on some features because they just didn’t fit, you’ve booby trapped yourself into paralysis and you long to throw away all the code…

Repeat as needed.

Now I’m not saying that there is no value in Data-Binding. But the big question is: why? Why use Data-Binding at all? The ‘hello data’ demo looked good, but that’s because it used intelligent defaults to make it look smarter than it truly was. And what did it do for you? Mainly: Assignment in a loop. In retrospect typing foreach a couple of times no longer looks very taxing.

The moral? You can’t get away without using 3rd party libraries. But be careful to choose the ones that solve real problems not the ones with the best 3-minute demo.


8 Responses to Why Databinding Sucks…

  1. Stouby says:

    I’ll not waste more time on DataBinding. It truly sucks.
    It may have been made for people, who don’t know anything about SQL-coding.

  2. Chris says:

    Agreed, I am now stuck deep in Windows Forms 2.0 databinding. I am going to basically have to rewrite this app now. What a waste of time.

  3. Matthew says:

    Data binding can take web controls with it to the hell where useless high-level abstractions go to die. After realizing the awkwardness it takes to get performance out of the ASP.NET GridView control (try to combine data binding and paging without it sucking in the whole collection at once anyway), I’ve recently decided it’s more efficient for my development and the code’s execution to return to good old for(;;) loops and HTML output.

  4. […] “Why Databinding Sucks” – Blog posting about data binding. […]

  5. sve za mob says:

    sve za mob…

    […]Why Databinding Sucks… « London Coder[…]…

  6. jaizon lubaton says:

    this is funny, but true i find data binding not that good, it compromises code readility just my own opinion. its easier to do one setter and getter function to update groups of text field! not sure why JSR 296 was dead because of the reasons above.

  7. My family all the time say that I am wasting my time here at web,
    but I know I am getting know-how all the time by reading
    such fastidious articles or reviews.

  8. Thank you, I have reently been looking for
    information approximately this topic for ages and yours iis the best I have found
    out till now. But, what about the conclusion? Are you certain inn regards
    to the supply?

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: