zoukankan      html  css  js  c++  java
  • [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.
  • 相关阅读:
    android videoView 加载等待
    LocalBroadcastManager
    sessionStorage 、localStorage
    javascript 数组、json连接
    properties 文件注意事项
    nutz 使用beetl
    [Git/Github] ubuntu 14.0 下github 配置
    【UNIX环境编程、操作系统】孤儿进程和僵尸进程
    【操作系统】进程间通信
    【操作系统】线程
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4329574.html
Copyright © 2011-2022 走看看