Backbone is becoming wildly popular as a web application development framework. along with this popularity comes countless extensions and plugins to enhance the power of the Framework, and fill in holes that other felt needed filling. let's take a look at some of the best choices.
Backbone. Marionette
Developed by Derick Bailey, this extension is quite large and is my personal favorite. rather than adding one or two features to backbone, Derick decided to fill in all the biggest holes that he felt existed. here's what he says about it in the README file of thegithub project.
"Backbone. marionette is a composite application library for backbone. JS that aims to simplify the construction of large scale JavaScript applications. it is a collection of common design and implementation patterns found in the applications that I (Derick Bailey) have been building with backbone, and between des varous pieces using red by Composite Application ubuntures, such as Microsoft's "prism" framework."
Let's take a closer look at what marionette provides us:
- Application: This is a central object that everything in your application can communicate through. it offers a way to set up the main view (s) of your application quickly and easily, A central event hub that every module in your application can communicate through so they aren't dependent on one another, and initializers for fine-grained control of how your application boots up.
- Modules: a means of encapsulating module code and namespacing those modules on the central application object.
- Views: New View classes to extend that offer native methods for cleaning up, so you don't end up with memory leaks. it also contains rendering boilerplate; for simple views, simply specify the template and model, and it'll handle the rest.
- Collection/composite views: This is where the "Composite Application library" bit comes into play. these two views allow you to easily create views that can handle the process of rendering all the views in a collection, or even a nested hierarchy of collections and models, with very little effort.
- Regions and layouts: a region is a object that can handle all the work of rendering, unrendering, and closing views for a particle place In the Dom. A layout is simply a normal view that also has regions built into it for handling subviews.
- Approuter: A New Type of router that can take a controller to handle the workload so that the router can just contain the configuration of the routes.
- Events: extended from the wreqr project, marionette makes backbone's events even more powerful for creating large-scale event-based applications.