O'Reilly logo

Better Backbone Applications with MarionetteJS by Joseph Zimmerman, Smashing Magazine

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

Chapter 8: Events, Commands, and Requests and Responses

In object-oriented programming, there are countless good reasons (testability, maintenance, and so on) as well as countless good ways (dependency injection, interfaces, and the rest) to decouple objects from one another. One of the ways to decouple objects is by using events. If you’ve used Backbone for any length of time, I hope you’re familiar with events because Backbone uses them quite liberally and consistently throughout the library.

Events belong to a category of decoupling known as messaging. Of course, what good is a category if there is only one item that fits into that category? Pretty pointless, so obviously there are more patterns that fit the bill. Some of those are commands ...

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