Hacker News new | ask | show | jobs
by TomOfTTB 5452 days ago
I'm not sure I know what you're talking about. I was talking about Data Binding in the context of Microsoft technology. So, for example, when you want a grid to reflect an entire database table you can define the table and this with two lines of code (grid.datasource = table and then grid.databind()) the grid will reflect the table. It takes care of all the hard stuff as far as pagination, sorting columns, and even updating and deleting are taken care of automatically.

It is a really quick and easy way to do things (and I don't question how amazing it is in its depth of ability). But it creates almost constant chatter as the grid is reflecting all changes off the database.

3 comments

I'm sure there must be a template for this where you can see pretty intimately how it works and completely change it. In WPF land they're lookless controls. The databinding gives you a local copy of an object that is updated (via things like INotifyPropertyChanged) and then templates render it. There's no magic. Just a lot less code to write.
Oh, that kind of databinding. That doesn't really bear any relation to what knockout does :)
I see what you're saying. Yeah, one certainly needs to be careful with those sort of high-level abstractions. I remember when I first started learning WPF, I ran into the exact problem you described. I had a data grid bound to an sqlite database. Without optimization, every row update was making three of four calls to the database. When there were a few thousand records, the UI would screech to a halt.