It’s not only cleaner, it’s also an excellent architecture to make responsive applications. Less information needs to be exchanged with the server – the formatting (views and controllers) being on the client, you only need to exchange the data being manipulated on the REST interfaces.
No full page reload – the server sends a static HTML file upon the first request, then the JS client handles the interaction with the user, only remodelling the portions of the DOM that changes between pages. And, better still, Backbone.js takes care of a large part of the work required to synchronise data with the server. Sweet!
However, when I recently started to learn about Backbone, I realised it doesn’t help to handle relationships between models. Most non-trivial applications need this – forum threads each have a series of comments, billing invoices have several items to charge for…
So, how do you structure your views to represent the relations between models? How do you update or push relational models to their corresponding REST APIs?
I’ve written a tutorial to answer that – showing, step by step, how to structure a sample application (a simplistic forum), using Backbone-relational to expose inter-dependent models from a set of REST APIs. You can also have a look at the code on the tutorial project page, on GitHub.
Update: The tutorial is now featured on the home page of Backbone-relational :D