Backbonejs

Just finished backbonejs course on Lynda (Up and Running with Backbone.js with Kai Gittens) and am super excited about getting into Backbone a bit more. At the moment I’m working on getting a previously written fixtures javascript project (http://gillianmcauliffe.com/fixtures/) into backbone. When I wrote the original project I really struggled with the fact that everything is kind of messy and all lumped together on one page. I’m finding that backbone forces that modularised approach and makes it much easier to separate out data from everything else. Also getting to dip a toe into underscorejs for templating – definitely will be looking into this a bit more in future.

So.. quick reminder tips for starting with backbone – there are 6 distinct decoupled components in Backbonejs – they are:

  • Models – for storing data
  • Collections – which are groups of models
  • Views – which are how the model data will display onto a page
  • Events – where custom events will be bound to the code – note that although events are decoupled their code is often mixed in with the other modules.
  • Routers – used for navigating around the webapp
  • Sync – used for mapping backbone to server side