3 ms·
And then you try to use it for more complicated cases, run into limitations and switch to backbone.
by rimantas 14y ago
And then you try to use it for more complicated cases, run into limitations and switch to backbone.
- scotty79 14y agoI've done Backbone course in codechool.com It's very basic and targeted at beginners but in last lessons already I've seen how it becomes tangled and begins to fall apart. I feel that Knockout provides you with much more structure that prevents you from making too much of a mess. Custom bindings provide easy way to insane flexibility http://learn.knockoutjs.com/#/?tutorial=custombindings http://learn.knockoutjs.com/#/?tutorial=custombindings and the models don't look like hundredth attempt at just implementing CRUD. Also no re-rendering of html and no need for rebinding DOM events (vide http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simple/ http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt... ). Thus my noob preference.
- krosaen 14y agoknockout and backbone serve different goals: http://stackoverflow.com/a/6340870/231589 http://stackoverflow.com/a/6340870/231589 For me, the dependency tracking and automatic ui refresh provided by knockout hits the sweet spot, functionality that isn't in the scope of what backbone provides.
- WickyNilliams 14y agoI take issue with this kind of generalisation. I don't think these problems are inherent to knockout, but I do think there is a lack of architectural guidance on building large apps with it. That said, building a maintainable, extensible knockout app is the same as building any other object-oriented system. First, decompose your app into multiple view models (a single view model doesn't have to be bound to the entire page) with clearly defined responsibilities. Combine that with a good Pub/Sub system [1] and you're most of the way there. That said, it would be nice to see some examples of large-scale knockout apps, as there doesn't seem to be much discussion out in the open in this area. A perfect candidate (in my mind) would be for Steve to release the source code for the knockout tutorial site since that is fairly complex. [1] https://github.com/rniemeyer/knockout-postbox https://github.com/rniemeyer/knockout-postbox