Knockout.js: Update Controls for JavaScript

Whenever I demo Update Controls for WPF, Silverlight, or Windows Forms, I usually get the question “What about the web?” My answer has always been that Update Controls doesn’t work on the web because the user interface (in the browser) is far removed from the data model (on the server). Fortunately, Knockout.js solves that problem.

Steven Sanderson created this elegant JavaScript library that does automatic dependency tracking the same way that Update Controls does. He solves the far-removal problem by moving the data model into the browser. Write your web app using JSON services, and pull your data into the browser. Then use the Knockout templating engine to transform that data into the view. The view will be dependent upon the data, so it updates when it changes.

With XAML data binding, MVVM, Knockout, and Update Controls, the concept of automatic dependency tracking is starting to make its way into the mainstream. Before long, it will find its way into our programming languages.

Leave a Reply

You must be logged in to post a comment.