Compare of Ember and Angular - bernardopnunes/SoftwareEngineeringSDUW GitHub Wiki

Groups:

  1. dsNo1
Group Members:
1. (Leader)Zijun Wang(@ZijunWang810)
2. Jia Gao(@gaojia1999)
3. Huachen Gao(@GaoHchen)
4. Jiaming Gu(@olivergu6657688)
5. Kaixun Jiang (@deep-kaixun)
6. Weize Kong(@kongkk233)
7. Lihao Sun(@sunlihao2018)
8. Xiaonan Zhao(@voidzx123)
9. Yangbohan Miao(@S1mp13)
10. Tianhao Sun (@stickice)

Catalog

1.Quick Introductions

Ember

Ember.js is an open source JavaScript client framework for developing web applications and using the MVC (model view controller) architecture pattern. In Ember.js , the route is used as the model, the handlebar template as the view, and the controller processes the data in the model.

Feature Explanation
Open Source Ember.js is an open source JavaScript framework (MIT license)
Flexible It is a flexible framework, including the concept of fast web pages. It allows you to speed up the performance of your application without reloading the entire page
Core with HTML It has a handlebars template library like HTML, and embeds expressions that change display
Smaller Compared to other Javascript libraries, the size of the Ember.js application is smaller
Relevance Data binding is fully supported. It creates a link between two properties. When one property changes, the other property updates to the new value

Ember

Angular

Angular.js is a JS framework created by Google, which can be used to extend HTML vocabulary in applications, so as to use HTML to declare dynamic content in web applications. Angular.js allows you to extend the syntax of HTML, so as to express the components in the application clearly and concisely, and allow standard HTML as your template language. Through bidirectional data binding, angular.js can automatically synchronize data from the UI (view) with JavaScript objects (models).

Feature Explanation
Two-way data binding The model and the view are completely bound together, the model changes, and the view also changes, and vice versa
Template In AngularJS, the template is equivalent to the HTML file is parsed into the DOM by the browser, AngularJS traverses these DOM, which means AngularJS uses the template as a DOM to operate, to generate some instructions to complete the data binding to the view.
Declarative dependency injection The design pattern of the back-end language is given to the front-end code, which means that the front-end code can improve the reusability and flexibility. In the future, the pattern may put a lot of operations on the client, and the server only provides data sources and other operations that the client cannot complete
Perfect page instructions It can be used to create custom tags, decorate elements, or manipulate DOM attributes
Test Driven Development Angularjs has taken this as the goal from the beginning. Applications developed using Angular can easily perform unit testing and end-to-end testing, which solves the defect that traditional js code is difficult to test and maintain

Angular

# 2.Comparison ## Ember ### Advantage 1.Ember.js perhaps is the most opinionated mainstream framework, which is also its biggest advantage. It has the right way to create an creation Ember.js application and it is usually the only one way. Ember.js is more like a product or platform, where you will go to a supplier for long-term support and maintenance. Ember.js provides a comprehensive version management of its platform, upgrade tools and powerful guidance and tools for API upgrade. Maturity is a good summary of it.

2.Ember.js has been proven over years that it can keep its framework in line with modern standards without forgetting traditional browsers too early.

3.Ember.js is a clear and reasonable architecture to build web applications comprehensively.

4.Ember.js is smaller than other frames

Disadvantage

1.Ember.js is probably the most opinionated mainstream framework, which is also its biggest weakness. Although communities are open and invested, it can be challenging to find the right way out of the downturn.

2.Having a rich third-party community can also be challenging. Since there are no UX components available for immediate use, this is likely to let you use third-party suites.You may find that while these suites are not comprehensive, you will need to build or look for other components. Because Ember.js has no extensions, you'll find that you have inconsistent widgets on how to interact and manage the DOM, and you don't have any easy to manage interface.

Example:

The warehouse is the central warehouse where the application stores records. You can think of the warehouse as a cache of all the data of the application. Both application controllers and routers can access this shared warehouse; when they need to display or modify a record, they first need to access the warehouse.

DS.Store instance will be automatically created, and the instance is shared by all objects in the application.

You can use this instance to get records, create new records, etc. For example, you need to find a record of type App.Person and ID 1 in the routing model hook:

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return this.store.find('person', 1);
  }
});

Angular

Advantage

1.The template has powerful and rich functions, and brings with it extremely rich angular instructions.

2.It is a relatively complete front-end framework, including services, templates, data bidirectional binding, modularization, routing, filters, dependency injection and other functions;

3.Custom instructions, which can be used multiple times in the project.

4.NG modularity boldly introduces some Java things (dependency injection), which can easily write reusable code, which is very helpful for the agile development team.

5.Angular.js is developed by Internet giant Google, which also means that it has a solid foundation and community support.

Disadvantage

1.It's easy to get started with angular, but it's difficult to understand it.

2.There are very few examples of documents. The official documents basically only write the API, but none of them.

3.It is not very good for IE6 / 7 compatibility, but it can be solved with jQuery.

4.There are few best practice tutorials for instruction application. Angular is actually very flexible. It is easy to write strange code without looking at some author's use principles.

5.Di dependency injection if code compression requires declaration.

  1. Angular.js need to traverse the entire DOM when the application starts. The larger the application, the slower the start-up speed.

Example

When AngularJS is loaded, it will search the ng-app feature in the document. This label is usually set to the main module of the project. Once discovered, Angular will operate on the document.

In this example, the ng-init feature initializes a msg variable "tianhao", and the ng-model feature bidirectionally binds it to the input control (note: curly brackets are binding tags). AngularJS will parse this tag and update the msg text value in real time as the input value changes.

<html>
  <head>
    <script src="http://code.angularjs.org/angular-1.0.1.js"></script>
  </head>
  <body ng-app ng-init="msg = 'tianhao'">
    <input ng-model="msg" />
    <p>{{msg}}</p>
  </body>
</html>

Ember VS Angular

Ember.js is more community-based and more suitable for production environment

Compared with ember.js, angular.js is more like a research project. For example, in a learning document, Ember.js It focuses on models, views, and controllers, while the angular.js guide requires you to learn something like scope, indicator, and translation. Some big companies are already Ember.js I put a lot of time and energy into it. After the disappointment, the whole web layer of square is also based on Ember.js Yes, Groupon's mobile web app also uses Ember.js Developed. In addition, there are many startups through Ember.js Success and start giving back Ember.js community. At present, most of the applications developed with angular.js are just demonstration projects or internal projects of Google.

Angular.js conforms to the future of the web

Angular.js makes me feel like writing a web application that really supports all web concepts and extends HTML in a very fluid way. In fact, angular.js does not use its own objects or rewrite JS methods. When you use angular.js, you use pure JS, and many of the concepts implemented by angular.js will directly enter the next version of JavaScript. Learning angular.js means learning future JavaScript and learning Ember.js , you just learned the unique concept of Ember.

# Conclusion In general, Ember has a perfect system. You can quickly build projects and greatly improve development efficiency. However, it has many constraints, can't be transformed freely and has poor expansibility. Angular is very free and can be expanded at will, but its use is complex and requires developers' own excellent level. Although it is supported by Google, its formality is not as good as that of Ember.

References

1.https://blog.csdn.net/java_xxxx/article/details/80198321

2.https://www.w3cschool.cn/emberjs/emberjs_overview.html

3.https://blog.csdn.net/qq_40406929/article/details/84339002

4.https://www.angularjs.net.cn/

5.https://www.cnblogs.com/powertoolsteam/p/4991732.html

6.https://www.w3cschool.cn/emberjs/emberjs_overview.html

Division of Work

Group: dsNo1

  • Xiaonan Zhao(@voidzx123): Quick Introduction
  • Yangbohan Miao(@S1mp13): Compare->Disadvantage(Angular) and Compare->Advantage(Angular)
  • Tianhao Sun (@stickice): Compare->Disadvantage(Ember) and Compare->Advantage(Ember)
  • Jia Gao(@gaojia1999): Compare->Ember vs Angular
  • Weize Kong(@kongkk233): Conclusion
  • Zijun Wang(@ZijunWang810) && Jiaming Gu(@olivergu6657688): Presentation
  • Kaixun Jiang (@deep-kaixun) && Huachen Gao(@GaoHchen) && Lihao Sun(@sunlihao2018): Poster
⚠️ **GitHub.com Fallback** ⚠️