Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Backbone.js

7,036 views

Published on

Published in: Technology
  • Be the first to comment

Backbone.js

  1. 1. Backbone.js <ul><li>@tonyskn #parisjs Jan 2011 </li></ul>
  2. 2. What? <ul><li>Oct 2010 </li></ul><ul><li>DocumentCloud => Underscore.js, Coffeescript. </li></ul><ul><li>MVC: Model, Views, Collections </li></ul>
  3. 3. Why? <ul><li>Avoids storing state in the DOM </li></ul><ul><li>Avoids jQuery callback soup </li></ul><ul><li>Lightweight. A good replacement for heavier frameworks. </li></ul>
  4. 4. How? <ul><li>JSON models with custom events </li></ul><ul><li>Collections API </li></ul><ul><li>Views with DSL for declaring events </li></ul><ul><li>Auto syncing with RESTful JSON interface </li></ul>
  5. 5. ... <ul><li>Controllers and History </li></ul><ul><li>Backbone.Controller.extend({ </li></ul><ul><li>routes: { </li></ul><ul><li>&quot;help&quot;: &quot;help&quot;, // #help </li></ul><ul><li>&quot;search/:query&quot;: &quot;search&quot;, // #search/kiwis </li></ul><ul><li>&quot;search/:query/p:page&quot;: &quot;search&quot; // #search/kiwis/p7 </li></ul><ul><li>} </li></ul><ul><li>localStorage adapter </li></ul><ul><li>https://github.com/jeromegn/Backbone.localStorage </li></ul><ul><li>CouchDB connector </li></ul><ul><li>https://github.com/pyronicide/backbone.couchdb.js </li></ul>
  6. 6. +/- <ul><li>Too verbose and complex for simple stuff. </li></ul><ul><li>Needs hacking for advanced usage (nested models...) </li></ul><ul><li>Lightweight </li></ul><ul><li>Excellent documentation </li></ul><ul><li>Completely agnostic to how you implement views </li></ul>

×