随笔:24 文章:1 评论:66 引用:0
BlogJava 首页 发新随笔
发新文章 联系 聚合管理

2006年6月1日

前面转贴Liebeck(echo的主要开发者,我的偶像)关于echo2和gwt的对比:http://www.blogjava.net/steeven/archive/2006/06/01/49379.html

今天仔细做了一些笔记,并且加入了一些自己的想法,供选型者参考:

综合对比:
1. 两个都是非传统的b/s框架,都是用AJAX来构造动态网站。编程过程都和SWT/Swing差不多。
2. 区别在于一个运行于客户端,一个运行于服务器

3. gwt把代码编译为html+js, 目前只支持java1.4规范。echo没这限制。
4. gwt可以运行于任何web server, echo则需要传统的servlet容器。(意义不大,现在哪有静态网站啊,后台交互肯定还是需要的)
5. echo2的客户端引擎通过ajax提交用户动作,对用户界面增量更新。
 
性能:
1. gwt的页面logic都在浏览器上,所以很快。但是如果需要和中间层交互,就会碰到同样的网络问题。
2. echo2的代码跑在server上,所以所有的交互都需要反馈给server。echo2在设计上尽量减少这种交互,比如客户对文本的修改都是延迟发送到服务器,而服务器只发送页面的变化部分到浏览器。
3. gwt应用被编译成一个页面,虽然应用的复杂化,这个编译结果也随之变得可怕。。。(个人认为随着编译器的发展,不同的页面可以做到lazy load)
4. echo的js模块是lazy加载到浏览器的,界面上呈现哪些控件才去加载并且缓存对应的js模块。发送到客户端的不是逻辑代码,只有用户状态(个人认为echo2现在过于lazy,导致初始化阶段多次访问server加载一些基本的js模块,应该揉合到一起。另外,因为echo逻辑代码在服务器上,相对来说可以防止盗版)
 
中间层和数据访问:
1. 如果要访问数据,gwt还是要回到传统的模式,通过rpc访问servlet。gwt提供把远程服务透明的包装起来,中间传送pojo. 尽管包装了,中间的安全和和校验还是必须要开发者考虑。
2. echo支持SOA,但是不必须。大多数情况下安全不是问题,因为数据和逻辑都不会暴露到浏览器上。(以前给echo提过建议,浏览器用户很可能去模拟一个被disabled按钮提交,这种问题现在无需考虑)
 
运行环境:
1. gwt运行在浏览器上,并非所有的java类都能编译成js. gwt现在只支持java.lang/java.util下面的一个子集(版本 1.0.21):27 classes, 11 interfaces, and 18 exception(这让人想起了j2me开发). 一些现有的类库就别想了。
 
调试:
1. gwt调试需要一套和运行时完全不同的环境:HOST模式,代码作为真正的java在运行。(个人认为这里因为是纯java调试,比echo的web调试要稍微方便一些。做单元测试也更方便些,但不是对最终browser的测试)
2. echo调试就是传统的servlet调试。
 
授权:
1. gwt的api是开源的,编译器和host模式浏览器不公开。整体来说:free. (个人认为,如果要扩充gwt可能会遇到麻烦)
2. echo2开源,mozilla public license. free(个人认为:echostudio也free就好了。nextapp毕竟要生存)
 
应用:
1. gwt可以嵌入传统的静态html, 也能作为一个完整应用。做大应用要考虑编译后的重量、本地化、库支持等问题(关于18n, 可以在gwt支持论坛上搜索i18n,似乎已经有方案)
2. echo2成熟得可以适用各种应用,但是不能作为静态页面的一部分使用。(有点吹牛,在大访问量下,服务器的压力肯定不会小)
 
 
 
个人结论:
1. 开发方式都很优秀,用纯java开发b/s
2. gwt可用于大型网站,把压力转嫁给客户端。
3. echo可用于快速开发复杂的企业应用,把压力丢给服务器(企业里面最清闲的就是前台和服务器)

两个产品都很优秀,GWT是2006年的IT飓风,波及后面几年。M$的日子要难过了, GOOGLE的确是个令人头痛的对手。

然而,还有比gwt/echo2更美好的未来吗?
有!把他们的输出变成flash,用java开发flash应用。去年探索过一段时间,原型已经出来,因为flash开发调试太ugly, 没有继续下去。
另外,微软的WPF(AVALON)相当值得关注。
posted @ 2006-06-01 11:32 steeven 阅读(1603) | 评论 (3)编辑 收藏
 

Google Web Toolkit 虽然还是beta版本,和google的其他产品一样,刚出生就注定不凡,也许将影响后面几年的b/s开发。

gwt利用了java开发的一切成熟条件,包括Unit test, refactor, IDE(eclipse...),传统的b/s framework必将受到重创,横扫过后,JSF/ECHO等Server side framework可能幸存。如果哪天google加上serverside支持(从包命名上看是留有余地的)。。。虽然gwt目前还是小样一个,但是背后站的是重量级的google,强大的资源和数不完的银子。。。。

看到这玩意首先想到的是echo2, 客户端技术都是ajax, 编码都是java. 不同的是gwt发行时编译成HTML+JS,Echo2则是完全的服务器端生成+更新。gwt跟server端交互依靠类似于ws的service把前后台完全区分开。

在echo的论坛里面已经有人在讨论这玩意了,并且八卦了一下gwt的前身似乎是Morfik的一部分(待证实)
从原理上,echo的开发者作出了对比,这个网站似乎被封锁,这里转贴一下:


===============================
http://echotwo.blogspot.com/ 作者tod liebeck

Comparing the Google Web Toolkit to Echo2
The Google Web Toolkit (GWT) is being compared to Echo2 quite frequently. Some of these comparisons have been fairly accurate, while others contain bits of misinformation. This article, written by the lead developer of Echo2, discusses the similarities and differences between these two frameworks.

Overview

The Google Web Toolkit and Echo2 definitely make for an interesting comparison. Both of these frameworks take a non-traditional approach toward web application development, even considering the latest crop of "AJAX-based frameworks" available today.

The most obvious similarity between GWT and Echo2 is that they both enable the developer to create dynamic, AJAX-driven web user interfaces using only Java. In both projects, UIs are developed in a fashion similar to SWT or Swing: by assembling hierarchies of components and registering event handlers. Neither project requires the developer to work with HTML, JavaScript, or XML.

The most obvious difference between GWT and Echo2 is that all of your GWT code is executed on the client, whereas your Echo2 code is executed on the server. There are advantages and disadvantages to both of these approaches, which will be highlighted throughout the article.

GWT's defining attribute is the Java-to-JavaScript compiler. This compiler allows you to develop the web interface to your application in Java, then compile it to JavaScript. GWT limits the developer to a subset of the Java 1.4 libraries. GWT applications can be served by any web server, such as Apache, without the need for server-side processing.

Echo2 applications are compiled to Java byte code and run on a Java server. Their Java code is executed by Echo2's "Web Application Container" layer, which sits atop a Java Servlet. On the web browser, the Echo2 "Client Engine" communicates user input to the Web Application Container via AJAX requests, with the server responding with directives to perform incremental updates to the state of the client web browser.

User Interface Performance

With GWT, all of your user interface code exists on the client browser. In operations that do not require server communication--that is, that do not require retrieving data from the middle tier--this configuration results in response times that are not dependent on the server. When data must be retrieved from the application's middle tier or business logic layer, the response time is subject to the same criteria as any other AJAX application, i.e., network latency, bandwidth, and server performance.

Echo2 application code is run on the server, so for each user interaction that requires a call to the middle tier or immediate execution of the application's Java code, an AJAX connection is made to the server. Echo2 components are designed to minimize the client/server communication as much as is possible, limiting it to times when the server must be notified immediately of events. For example, simple events such as user input to a TextField component will not result in server contact. The server's response is the minimum set of instructions to incrementally update the client to reflect the new screen state.

GWT applications are served to the client as a single HTML/JavaScript file, containing the entirety of the user interface. The size of this file will be proportional to the size of your user interface code and the toolkit libraries used by your application.

Echo2 JavaScript modules are lazy-loaded to the client, and thereafter cached. A module will be retrieved when a component first appears on-screen that requires it. Application code is never sent to the client, only the state of the user interface.

Middle Tier / Data Retrieval

To access business data or perform a business process, a GWT user interface makes a remote procedure call (RPC) from the browser to a Servlet. GWT provides a mechanism to make the RPC invocation transparent to the developer, allowing the developer to build the application with "Plain Old Java Objects" (POJOs). However, any application that provides an RPC capability is a distributed application -- even when the RPC is accomplished transparently to the developer. Distributed applications in businesses and enterprises usually have security considerations and the remote objects serving the GWT clients must be designed with a focus on security to deflect attacks from imitated or hostile client applications.

Echo2 applications support, but do not require, the use of distributed application logic or a Service Oriented Architecture (SOA). Alternatively, Echo2 applications can be built to run entirely within a single JVM instance, backed by a POJO-based middle tier. This allows Echo2 developers to build applications without the security concerns of distributed application logic -- and leverage the many strong frameworks built around POJO development such as the Spring Framework and Hibernate. Echo2 accomplishes this by keeping the state of a user's web interface on the server so that no remote objects need to be exposed.

Run-time Environment

GWT has some limitations due to the fact that applications are run on the client browser. First, GWT applications are limited to using a subset of the core Java class libraries, consisting of 27 classes, 11 interfaces, and 18 exception types found in the java.util and java.lang packages (as of GWT 1.0.21). This limitation prevents GWT applications from linking to most existing Java libraries. Additionally, all Java code must be compliant with the Java 1.4 specification; 1.5 is not supported. Localization-related portions of the Java API are not provided.

Debugging

GWT provides an alternate deployment environment for applications to facilitate debugging. The environment, called "Hosted Mode", allows a GWT application to be run as Java byte code in a local JVM, to which an IDE's debugger can be connected. In this mode, the application's user interface is displayed in a special web browser (a Mozilla/Firefox derivative).

Echo2 applications may be debugged in the conventional manner, by connecting an IDE's debugger to a JVM running a Servlet container.

Licensing

The primary component of GWT, the Java-to-JavaScript cross-compiler, is proprietary, binary-only software. The Java API libraries are open source software, distributed under the Apache License. The API libraries have essentially no value without the proprietary compiler. The (non-critical) hosted-mode browser is also under the proprietary license. GWT is provided free of charge.

Echo2 is open source software, licensed under the Mozilla Public License, and provided free of charge.

Applicability

GWT can be used as a means of creating AJAX components to embed in traditional web applications (or even in static web pages) as well as for creating complete application user interfaces. There are some issues to using it for the creation of large applications, where downloading an entire application to a client web browser in one shot would not be practical. The lack of localization and full Java API support also presents a problem for larger solutions.

Echo2 is practical for creating web applications of any size. It is however not intended to scale downward to function as a platform for simply creating AJAX components in traditional web frameworks (or static web sites).

More Information

Google Web Toolkit:
Home Page, Example Applications, Getting Started Guide, Developer Guide

Echo2:
Home Page, Example Applications, Tutorial
posted by Tod Liebeck at 5:13 AM | 0 comments  

======================================
毕竟gwt还是小baby, 以后怎么发展还难说,现在下结论太早。这两天试用一下,有空从细节上对比一下。

posted @ 2006-06-01 00:55 steeven 阅读(405) | 评论 (0)编辑 收藏
CALENDER
<2006年6月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

常用链接

留言簿(7)

随笔分类

随笔档案

文章档案

相册

我的链接

搜索

  •  

最新评论


Powered By: 博客园
模板提供沪江博客