The three JavaScript frameworks compare--angularjs, Backbonejs and Emberjs
Chszs, reprint need to indicate. Blog home:Http://blog.csdn.net/chszs
If you have a heart search, you can find hundreds of javascript frames. JavaScript is the basic technology necessary when we are developing a modern, agile and cool website. So the question is, how do you choose the framework that best meets our needs in so many JavaScript frameworks? This is a difficult problem. And there are many challenges, such as making websites behave and look the same on different client browsers, which is not easy. Choose the most appropriate JavaScript library to assist with our development, simplify development, and reduce development time.
The most popular JavaScript library is jquery, which provides a set of JavaScript functions that reduce a lot of development effort. But jquery is just an auxiliary library, a library that really needs to be large on the front-end MVC pattern, or a few three JavaScript libraries: AngularJS, Backbonejs, and Emberjs. I'll compare the three JavaScript libraries below.
I. INTRODUCTION 1, AngularJS
Angularjs is an open source JavaScript framework that is invented by Google and is responsible for evolution and maintenance. Angularjs based on the MVC architecture, the goal is to make development and testing more efficient and easier. ANGULARJS extends the traditional HTML code, allowing dynamic content to be bound to the page elements in two directions. ANGULARJS is an independent framework, which means that it does not depend on any other JavaScript framework.
2, Backbonejs
Backbonejs is an open-source, lightweight MVC framework. It was born in 2010 and developed very quickly and soon grew into a JavaScript framework that replaced bulky, full-featured MVC architectures such as ExtJS. This has led many foreign Internet companies to start using it to build their own application services. such as Pinterest, Flixster, Airbnb and other companies. The Backbonejs library provides a model for key-value bindings, custom events, and makes Web applications more structured, with a set of rich APIs with enumeration functions and views. The Backbonejs library can connect your existing APIs via a restful JSON interface. The Backbonejs library relies on the Underscore.js library.
Backbonejs models can be created, validated, destroyed, saved to server-side operations. The view is used to show the state of the model, which can be triggered when the property has changed, and the view responds and reproduces the new information. Backbonejs is an attempt at a minimal set of data structures (models and collections) and a user interface (view and URL) primitives, which is useful for building JavaScript Web applications.
3, Emberjs
Emberjs to return to the 2007, it originated in the Sproutcore MVC framework, the Sproutcore framework was originally developed by Sproutit Company and later inherited and maintained by Apple. Until 2011, Yehuda Katz (who was the core contributor to the jquery project and the Ruby on Rails project) launched the EMBERJS project. It is worth noting that the users of the EMBERJS library include internet companies such as Yahoo, Groupon and Zendesk.
EMBERJS allows developers to create extensible, single-page Web applications. It provides a rich set of handlebars.js libraries that include the object model, declarative two-way data binding, computable properties, templates for automating updates, and a router to manage the state of the application.
Chszs, reprint need to indicate. Blog home:Http://blog.csdn.net/chszs
Ii. comparison 1, community
An important factor in the selection framework is the size of the framework community and the number and activity of developers. The Angularjs community is the largest, faster-growing, and most dynamic community. And Angularjs has more followers on GitHub, as well as more questions and answers in StackOverflow.
2, the size of the frame
Page load time is one of the key factors in Web application success. Two factors that users need to be able to quickly access information that affect page load times: The size of the JavaScript framework and the time it takes to start it.
Compare the compressed version of these three frames: AngularJS 1.2 version has 105kb,emberjs 1.9.1 version has 97kb,backbonejs 1.1.2 version has 65KB. However, the ANGULARJS framework has no dependencies, the BACKBONEJS framework relies on the Underscore.js library (52KB), and the EMBERJS framework and BACKBONEJS framework typically require the jquery library (82KB) to simplify operations. Therefore, the size of the ANGULARJS frame is really the smallest.
3. Templates
Both the ANGULARJS framework and the EMBERJS framework contain a template engine. The BACKBONEJS framework has no template engine, and developers need to select a third-party template engine to integrate into the project. Of course, for the BACKBONEJS framework, the Underscore.js library contains the template engine, which you can use.
4. Flexibility
There are many JavaScript plugins that can do a lot of specialized work. This is very useful because each of these frameworks is not exhaustive. Therefore, it is important for the framework to support plug-ins and support extensions. Compared to the BACKBONEJS framework is the most flexible framework, because it has the fewest conventions, developers can make a lot of decisions on their own when using. The EMBERJS framework and the ANGULARJS framework are somewhat flexible, but not flexible enough.
5. Learning curve
Developers of the ANGULARJS framework can quickly build Web applications and quickly use two-way bindings, essentially without learning. But to master the ANGULARJS framework, you need to learn some technical terminology, learning curve is also relatively steep. The learning curve of the EMBERJS framework is smoother than the angularjs.
The BACKBONEJS framework is easier to learn, but it also requires learning the Underscore.js library to master it.
Chszs, reprint need to indicate. Blog home:Http://blog.csdn.net/chszs
Iii. Conclusion
There is no best JavaScript framework, only the JavaScript framework that works best for you. In general, the ANGULARJS framework is relatively better, it is the fastest growing, more dynamic, with a huge community and Google behind the support. Backbonejs is a minimalist framework that is small in size and easy to learn.
Three JavaScript frameworks compare--angularjs, Backbonejs, and Emberjs