Using the Backbone router

Derick Bailey has some good advice regarding the backbone router: Stop Using Backbone As If It Were A Stateless Web Server.

A javascript application using backbone is stateful, and implementing MVC doesn’t mean that all actions have to be handled by the router. Only use the router when you want to expose a url in your browser history, something the user can bookmark or email.

I think it’s useful to look at it from a REST perspective: a url is an id or address of a resource. Use the backbone router to create urls to things that are resources, not to actions on resources.

blog comments powered by Disqus