Skip to content

Comment on An Intro to Backbone.js: Part 2 - Controllers and Viewsparent

Comments

One of the really nice things about Backbone is you can you as little or as much as you need. Don't need collections? Don't use them. No need for a controller structure? Not a problem. You could also build your own thinner structures on top of its Event structure to get the advantages of event-driven callback structures without any of the other stuff.

It sounds to me like you're using controllers because it seems logical coming from a Rails background, not because you need to. Take a look at the example Todo app - no controller, entirely atomic screen repaints as needed via collection/model to view bindings.

The models provide a framework for things like validation or presenter methods and keeping data and methods separate as well as a framework for event binding with a really, really nice syntax.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.