10种顶级javascript框架比较-The Top 10 Javascript MVC Frameworks
轉(zhuǎn)載于:http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/
Gordon L. Hempton是西雅圖的一位黑客和設(shè)計師,他花費了幾個月的時間研究和比較了12種流行的JavaScript MVC框架,并在博客中總結(jié)了每種框架的優(yōu)缺點,最終的結(jié)果是,Ember.js勝出。
| Framework | UI Bindings UI綁定 | Composed Views 復合視圖 | Web Presentation Layer Web表現(xiàn)層 | Plays Nicely With Others 與其他框架良好協(xié)作 |
| Backbone.js | ? | ? | ? | ? |
| SproutCore 1.x | ? | ? | ? | ? |
| Sammy.js | ? | ? | ? | ? |
| Spine.js | ? | ? | ? | ? |
| Cappuccino | ? | ? | ? | ? |
| Knockout.js | ? | ? | ? | ? |
| Javascript MVC | ? | ? | ? | ? |
| Google Web Toolkit | ? | ? | ? | ? |
| Google Closure | ? | ? | ? | ? |
| Ember.js | ? | ? | ? | ? |
| Angular.js | ? | ? | ? | ? |
| Batman.js | ? | ? | ? | ? |
1. Backbone.js
Backbone.js 是web人士的最愛和首選.? GroupTalent.
優(yōu)點pros: 良好的兼容性. Underscore.js (也比較大量地使用) 則是另一個很好框架. 強大的社區(qū),強勁的勢頭
缺點Cons: Lacks strong abstractions and leaves something to be desired. The entire framework is surprisingly lightweight and results in lots of boilerplate. The larger an application becomes, the more this becomes apparent.? 抽象較弱,很多功能亟待增加
2. SproutCore 1.x
SproutCore is what Apple used on its iCloud initiative. Despite having a horrible name, it is actually an extremely well thought out framework. It is also one of the largest frameworks.
優(yōu)點pros: Bindings support. Solid community. Tons of features. 對綁定的支持,可靠的社區(qū),大量特性;
缺點Cons: Overly prescriptive. Hard to decouple from unneeded features. Forces a native-like paradigm. I have a serious problem with any framework which discourages using html for layout.? 過度規(guī)范,難以和不需要的特性解耦。
3. Sammy.js
Sammy.js was a smaller framework that I stumbled upon. Due to its simplicity, it almost didn’t make this list. It’s core feature is a routing system to swap out areas of an application with AJAX.
優(yōu)點pros: Simple learning curve. Easier to integrate with an existing server side app. 易于學習,更容易和現(xiàn)存的服務端應用程序整合
缺點Cons: Too simple. Not sufficient for larger applications. 過于簡單,無法應用于大型應用程序中。
4. Spine.js
Based on the name, Spine.js is obviously heavily influenced by backbone. Like backbone, it is very lightweight and follows a similar model.
優(yōu)點pros: ?Lightweight with good documentation. 輕量級,文檔很完備;
Cons: Fundamentally flawed. A core concept of spine is “is asynchronous UIs. In a nutshell, this means that UIs should ideally never block”. Having built a serious non-blocking realtime application in the past, I can say this is entirely unrealistic unless the backend has something like operational transformation. 它的核心概念“spine”是異步的用戶界面,這意味著理想狀況用戶界面永遠不會發(fā)生堵塞,而這個基礎(chǔ)有缺陷。
5. Cappuccino
Cappuccino is one of the more unique frameworks, coming with its own language Objective-J. Cappuccino tries to emulate Cocoa in the browser.
優(yōu)點pros: Large thought-out framework. Good community. Great inheritance model.? 大型深思熟慮后的框架,良好的社區(qū),很棒的繼承模型;
缺點Cons: Out of all the languages you could emulate in javascript, Objective-C would be my last choice. This is coming from an iOS developer. I simply can’t get past the idea of programming Objective-J in the browser.? 由iOS開發(fā)者創(chuàng)建,使用JavaScript模擬Objective-C。
6. Knockout.js
Knockout.js is an MVVM framework that receives lots of praise from its supporters. It stresses declarative UI bindings and automatic UI refresh.
優(yōu)點pros: Binding support. Great documentation and amazing tutorial system. 對綁定的支持,完備的文檔和教程;
缺點Cons:?Awkward binding syntax and lacks a solid view component hierarchy. I want to be able to reuse components easily. I also feel like identifying as an MVVM framework is deleterious. Hardly any of these frameworks are MVC, but are of the MV* variety (MVP, MVVM, etc). 綁定語法拙劣,缺少統(tǒng)一的視圖組件層級關(guān)系。
7. Javascript MVC
Javascript MVC, in the interest of full disclosure, is a framework that I didn’t spend very much time evaluating.
優(yōu)點pros: Solid community and legacy.? 可靠的社區(qū);
缺點Cons: Awkward inheritance model based on strings. Controllers are too intimate with views and lack bindings. The name is way too generic - the equivalent would be if RoR was called “Ruby Web Framework”.? 基于字符串的繼承模型很差,控制器與視圖關(guān)系過密而缺少綁定。
8. Google Web Toolkit
GWT is a serious client-side toolkit that includes more than just a framework. It compiles Java to Javascript, supporting a subset of the standard java library. Google used it internally for Wave.?
優(yōu)點pros: Comprehensive framework with great community. Solid Java-based component inheritance model. Great for behemoth client-side applications.? 全面的框架,良好的社區(qū),可靠的基于Java的組件繼承模型;
缺點Cons:?Despite what Google says, GWT is not going to stand the test of time. With initiatives like DART its clear that Java is not the future of the web. Furthermore, the abstraction of Java on the client is slightly awkward.? 可能無法經(jīng)受時間的考驗,另外,Java在客戶端上的抽象有些笨拙。
9. Google Closure
Google Closure is more of a toolkit than simply a javascript framework. It comes bundled with a compiler and optimizer.
優(yōu)點pros: Use by Google for many of their major apps. Nice component-based ui composition system.? 很好的基于組件的UI組合系統(tǒng)。
缺點Cons: Lack of UI-binding support. 缺少UI綁定支持。
10. Ember.js
Ember.js (formerly Amber.js SproutCore 2.0) is one of the newest contenders. It is an attempt to extricate the core features from SproutCore 2.0 into a more compact modular framework suited for the web.
優(yōu)點pros: ?Extremely rich templating system with composed views and UI bindings.? 很豐富的模板系統(tǒng),擁有復合視圖和UI綁定;
缺點Cons: Relatively new. Documentation leaves lots to be desired.? 相對較新,文檔不夠完備。
11. Angular.js
Angular.js is a very nice framework I discovered after I originally posted this review. Developed by Googler’s, it has some very interesting design choices.
優(yōu)點pros: Very well thought out with respect to template scoping and controller design. Has a dependency injection system (I am a big fan of IOC). Supports a rich UI-Binding syntax to make things like filtering and transforming values a breeze. 對模板范圍和控制器設(shè)計有很好的考慮,擁有依賴注入系統(tǒng),支持豐富的UI綁定語法。
缺點Cons:Codebase appears to be fairly sprawling and not very modular. Views are not modular enough (will address this in more detail in the cons of Batman.js).? 代碼的模塊性不強,視圖的模塊化也不夠。
12. Batman.js
Batman.js, created by Shopify, is another framework in a similar vein to Knockout and Angular. Has a nice UI binding system based on html attributes. The only framework written in idiomatic coffeescript, it is also tightly integrated with Node.js and even goes to the extent of having its own (optional) Node.js server.
優(yōu)點pros: Very clean codebase. Has a nice simple approach to binding, persistence, and routing.? 代碼清晰,綁定、持久化的方法簡單;
缺點Cons: I very much dislike singletons, let alone the idea of enforcing singleton controllers. Suffers from the same ailments as Knockout and Angular with regards to nested components. I want to be able to declaratively reuse more than just templates. What Ember has over these frameworks is a way to declaratively re-use entire components that are backed by their own (possibly controller-level) logic.?? 使用了單例控制器。
(注解:英語水平有限,慢慢來翻譯)
轉(zhuǎn)載于:https://www.cnblogs.com/JoannaQ/archive/2012/08/31/2664734.html
總結(jié)
以上是生活随笔為你收集整理的10种顶级javascript框架比较-The Top 10 Javascript MVC Frameworks的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python能写什么脚本_你用 Pyth
- 下一篇: springboot md5加密_Spr