Some of the highlights from the post:<p>* You usually want to avoid having multiple client-side models for a single database row. Keeping your client-side schema close to your database avoids mapping headaches later.<p>* When navigating around, be sure to cancel outstanding ajax requests if the user clicks on another link before the response arrives.<p>* Lazy-loading of associated models is handy, described further here:<a href="http://backbonejs.org/#FAQ-nested" rel="nofollow">http://backbonejs.org/#FAQ-nested</a><p>... and a few more tips:<p>* You don't need to use an event when a simple callback will do.<p>* In terms of JS apps, Tim Toady is your friend: <a href="http://backbonejs.org/#FAQ-tim-toady" rel="nofollow">http://backbonejs.org/#FAQ-tim-toady</a><p>* You often aren't modeling the complete server-side state in the browser, so look for opportunities to simplify by glossing over data that only concerns the backend.
This looks like just what I need. I am trying to use Backbone for the first time after eyeing it for a long while, and I'm completely lost as to best practices when it comes to loading and rendering things, either from the router or from a view, and also when it comes to dealing with collections that are part of a model.<p>Here's hoping the next post comes soon!
One thing I'd like to see covered in discussing stateful web applications is handling concurrent use and modification of data of data by multiple users or even multiple devices/tabs from the same user. Moving state to the client can result in inconsistencies across clients as each one makes changes.<p>Locking data to prevent this is a usability problem. Pushing changes to the each client is a partial solution, but then you're faced with the users watching the data change in front of them, without any action on their part. This is especially a problem in complex applications with multistep workflows.<p>Perhaps it is outside the scope of this series, since this appears to be focused on the technical aspects of using Backbone rather than application design. But a discussion of patterns that overcome these problems would be very useful.
Every time I start reading Backbone documentation, my head hurts. This article is even worse.<p>What they need is a <i>simple</i>, to the point, complete examples of apps. There's one that I found that makes some sense to me:<p><a href="http://documentcloud.github.com/backbone/docs/todos.html" rel="nofollow">http://documentcloud.github.com/backbone/docs/todos.html</a>