backbone.js

Having come from a Ruby / Rails background, I was initially offput by Backbone.js' paradigm of models, views, and collections. Now that I've had a chance to build a few small projects with the versatile framework, I have a much better understanding of how to structure complicated relationships in Backbone. As the list of models in any project grows, you will almost certainly encounter a temptation to make a collection of collections. Consider a simple HTML5 audio player that can play or queue individual songs. We might represent it like this: var SongModel = Backbone.Model.extend({ defaults: { playCount: 0, }, play:…