[Backbone]Make Backbone Better With Extensions

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 includes various pieces inspired by composite application architectures, such as Microsoft's "Prism" framework."

Let's take a closer look at what Marionette provides us with:

  • 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 particular 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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值