
What happens when you don't use BackboneUp until recent years, client-side Javascript development has resembled the wild-west from a software design perspective. Libraries like jQuery have certainly helped, but with the rise of
Single-Page Applications, jQuery alone doesn't provide enough of an overall framework for large-scale client-side development. Fortunately, there's been a recent proliferation of Javascript MVC frameworks, both large and small. Backbone.js is one of these. It's lightweight, works with jQuery (although it doesn't need it) and seems to have some momentum behind it at the moment.Backbone.js isn't particularly large or opinionated in the manner of say, Rails. For an expert, that might be a good thing. But for a beginner, it's not so good. The API documentation is complete, yet joining the dots can be a little intimidating at times to a newby. Simple tutorials abound that describe how to hook up a single view to a single model, but it's unclear what approach to use for more complex UIs. What should be in a model and what should be in a view? How should models and views interact with each other?I have recently had the opportunity to work on a non-trivial Backbone.js application. In this entry I'll try to present an example that is slightly bigger than your average single model and view. Furthermore, I'll present it in a manner that is iterative, rather than just dropping the whole thing on you in one hit. You'll see that Backbone.js provides a good basis for building apps in an MVC style, although you will be faced with the same design decisions you'd have to make with any other MVC framework.Note that this isn't an introduction to Backbone.js, and assumes a little background knowledge of how the framework works.
25 July, 2011
/