Best application scenarios and features of Backbone. js and backbone. js

Source: Internet
Author: User

Best application scenarios and features of Backbone. js and backbone. js
Advantages and experience of Backbone Tip:

  • The View division decouples the View elements on the page to refine the granularity. Views communicate with models to avoid abuse of DOM events.
  • The communication between Model and Restful is very friendly to backend personnel.
  • Clear MVC Architecture
  • Collection/Model abstracts previously messy AJAX requests, making CRUD requests very convenient.
  • View-> Model is strongly recommended for one-way dependency, and the world will be much better.
  • It will be nice to have a modular loader such as SeaJS.
Some shortcomings of Backbone, or some unimplemented Feature:
  • The Model layer is relatively simple. If you want To support complex data relationships such as One-To-One or One-To-One, you cannot do anything. There is also a Model that can only belong to one Collection design, which is very limited when pages are complex. Example: http://www.zhihu.com/question/19843899 (Supplement: the Backbone. Relations plug-in is a solution to this problem https://github.com/PaulUithol/Backbone-relational By zjhiphop)
  • Same as above, the Model only has basic CRUD operations and cannot be well extended. The Backbone. sync method is not flexible to write. To expand it, you must rewrite the sync method.
  • The View layer does not have a strong Page Management Mechanism. For example, when the whole Page is changed through URL switching, how does the View still exist on the Page? If the object is directly destroyed, do you want to destroy the associated models and collections? Cache? How to manage Cache?
  • The memory management needs to be careful, and there is a lack of mechanisms to avoid repeated Model creation.
  • When the extends override parent class method is used, you have to write a string of SuperClass. prototype. someMethod. apply or something, so you cannot implement the _ super method ......
  • Very unfriendly to debugging.
  • The author has code cleanup (also a bonus item). this. $ el has been called for so long, and it is estimated that this. _ super will not be seen in this life.
  • Slow update.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.