Not that I’ve seriously tried any others … simply didn’t feel the need to. The way apps are usually organised is Backbone is that data is king. A view reacts to some user action and changes some data in a model. Everybody who’s listening for that change then reacts and does something either to their view (adding something new on the screen, say) or data gets changed. Sometimes a change in data will cause the browser URL to change. Whatever, the important part is events are usually communicated through state changes. Events Despite the god-like status of models, most of your code goes into views. Data changesuser actions Listening to data changes is easiest done in the initialize function, something like so: Okay, but what about user actions? That can get unwieldy real quick … Backbone has us covered with the events hash: But what happens when you add socket.io to the mix?
Adding socket.io But this feels dirty: Events.
With that, several open source frameworks and libraries were born to help us develop these somewhat complex applications. Backbone.js, while being one of the more popular choices, is also one of the smallest ones (in both terms of scope and actual byte count). So while Backbone is tremendously helpful, it does leave a lot of grunt work for us, the developers, to do ourselves. This sometimes creates a bit of friction when getting started, as we face common problems, expecting Backbone to take care of them for us, when in reality we may leave "holes" or hidden bugs in our app.
Here are some common ones, that are easily avoided, once we realize they exist.
Django + Backbone. Flask + Backbone.js. Developing Backbone.js Applications - By Addy Osmani (@addyosmani) Available free for open-source reading below or for purchase via the O'Reilly store.
Pull requests and comments always welcome. Prelude Not so long ago, “data-rich web application” was an oxymoron. Today, these applications are everywhere and you need to know how to build them. Traditionally, web applications left the heavy-lifting of data to servers that pushed HTML to the browser in complete page loads. Think of the Ajax shopping cart which doesn’t require a refresh on the page when adding an item to your basket.