Often faced with a new thing, a variety of problems always become the first driving force that motivates us to learn and explore.
For backbone, today the following questions are mainly raised:
Why do we need backbone?
What about the framework, his strengths and weaknesses, and its application scenario?
Front end Frame Many, why choose backbone study?
First, why do we need backbone?
With the development of the front-end technology, the rapid upgrading of user hardware, the continuous improvement of the browser, some of the previous tasks that need to be done on the server, can now be moved to the client to complete, especially now into the era of multi-user, Web application development model is also facing enormous challenges. The idea of MVC provides a good practice for us to solve multi-problems. JavaScript as a weakly typed scripting language, loosely flexible language style, leads to the organization and management of code becomes a headache. Can we use the idea of MVC to decouple the front-end architecture so that we can break down the focus to finer granularity, allowing code to be ordered from mess nested callbacks and gracefully. Backbone is an excellent front-end MVC framework that was born in this context.
Ii. advantages and disadvantages of this framework
Javascirpt The rise of Web applications, mainly through the use of Ajax to achieve local refresh, on-demand requests, good interaction and user experience is favored by people.
There is no forever silver bullet, any solution has its scope of application, which is the universal law of human cognition process
So what are the scenarios for backbone, and backbone is a good choice if a web app is going to use javascirpt for complex interactions, a single-page application, or an offline Web application. He was born to standardize and simplify the development of JavaScript. But if your app just uses some JavaScript for simple DOM operations, then jquery is completely enough, and note that although backbone is based on MVC, its basic components model, view, collection, In fact, it can be used as a data structure alone. When there is a lot of data interaction, it is appropriate to use backbone.
Backbone Disadvantage: SEO support is not good, because the use of AJAX data interaction, the formation of different page appearance, but the search engine will not execute the page Ajax, a lot of logical pages can not be included, Google has a solution, unfortunately, Google was blocked, Other search engine support how, still do not know, this is a mishap. There is the modular piece of code. In fact, these shortcomings are an unavoidable problem for all JavaScript frameworks.
Three why do you study backbone?
This is about the motivation of learning.
Want to go the front-end road, to keep up with the times, although these things in the actual production may not be able to use, through learning these frameworks, can improve their front-end skills, to deepen the understanding of JavaScript. before learning a angular, think this thing is very strong, but the current level is limited, difficult to start. compared with angular, I think the backbone is much easier to learn, and its holistic approach is similar to the back-end MVC approach. The framework itself is relatively independent (dependent on underscore dependency) code logic is more understandable, and the various tutorials are still quite numerous. I'm going to take this as a paving stone for learning angular.
Backbone.js Learning (1) Why do you want to learn Backbone---?