O'Reilly logo

Backbone.js Essentials by Jeremy Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Publish/subscribe

Backbone classes often wind up being tightly coupled together. For instance, a View class might listen to a Model class for changes in its data, and then, when this data changes, it might look at the attributes of the Model to determine what to render. This practice couples the View class to the Model class, which normally is a good thing as it lets you define the exact relationship you need between the two classes, while still keeping your code fairly simple and maintainable.

When you only have a few Models and Views, it's easy enough to manage their relationships in this way. However, if you are building a particularly complex user interface, then this same coupling can instead become a hindrance. Imagine having a single page ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required