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 14: Managing Data

Now that we have the foundation laid, we need to create some means of handling data, which will naturally be handled by Backbone’s Model and Collection classes. We’ll keep all the data in its own separate module. This isn’t necessary, but I like how it makes initialization work. You could also just place all of the data in a namespace on QuizEngine instead of bloating it with all of the features that come with a Marionette Module that won’t be used. I’ve heard of some developers putting all of their data in an Entities namespace, which is probably a good name for it, but I’m sticking with the simple “Data” name as a module.

Module Index

Since this is going to be a module, we’ll first add a folder for it in the js/modules ...

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