Announcing Backbone.js: Models, Collections and Views in 2.4kb
documentcloud.github.com
Announcing Backbone.js: Models, Collections and Views in 2.4kb
1–10 of 62 posts
Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#2Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#3We use Backbone.js at DocumentCloud for our document workspace. It took a few weeks to pull out all the pieces, but we rely on the JavaScript MVC that Backbone gives us for the entire workspace. (That too will go open-source, someday soon enough.)
I am personally planning on integrating Backbone into NewsBlur, an RSS feed reader, which currently has an ad-hoc model system. Backbone would give it the ability to update stories and feeds without having to remember where all of the stories and feeds are on the page.
Anyway, Backbone takes a bit of getting used to, but it is fairly easy to read the annotated source to see exactly what's happening. And once you do learn the Backbone.js conventions, hard problems become much easier on the front-end.
Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#4Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#5Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#6Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#7Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#8Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#9Sorry, I'm a little late to the party with respect to javascript. Could someone please explain to me what this means in english? Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interfa…
"key-value binding and custom events": When a model changes its state, other JavaScript objects can listen for that change and be notified. It's the usual inversion-of-control pattern, but especially crucial for models and views. A model has no business knowing about what views may or may not currently be present in the UI. Instead, the views listen to changes in the model, and update themselves accordingly.
"rich API of enumerable functions": JavaScript arrays are pretty feature-poor, at least in terms of things that will work cross-browser. Backbone collections include all of these handy functions for working with your data:
http://documentcloud.github.com/backbone/#Collection-Undersc...
"views with declarative event handling": Instead of creating a mess of nested jQuery "bind" or "delegate" calls, it's nice to just declare what elements in a view should be hooked up to specific callbacks:
http://documentcloud.github.com/backbone/#View-handleEvents
"RESTful JSON interface": The persistence strategy for Backbone can be swapped out for something different (Websockets, Local Storage, CouchDB), but the default is to fire off a standard JSON Ajax call when you call "model.save()"...
Hope that helps a little.
Re: Announcing Backbone.js: Models, Collections and Views in 2.4kb
#10Sorry, I'm a little late to the party with respect to javascript. Could someone please explain to me what this means in english? Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interfa…