JAVA学习网首页 把生活查询网加入收藏 把JAVA学习网设为首页 联系方式
    Hi,JAVA学习
JAVA基础 设计模式 数据库 JavaBeans J2EE JavaDelphi 用户界面 综合文章  
XWT 是一个我们需要重点关注的项目
时间:22/04/2007
作者:网络
来源:网络
小提示点这里把文章加入您的收藏夹,方便下次查看
设置文章字体大小:[ ]
XWT 是什么?一个与 XAML、XUL 类似的以 XML 来描述 GUI 布局的技术和 GUI 控件库。 
XWT 有什么优势?XWT 是完全跨平台的(IE、Mozilla、Opera;Windows、Linux、Solaris),不会像 XAML 或者 XUL 那样将你绑死在某个平台上,而且它很小,性能也很好。 

XWT 有两个版本,在 IE 里面是作为一个 ActiveX 控件来运行的,而在所有支持 Java 的浏览器里面(IE、Mozilla、Opera)都可以作为一个 Applet 来运行。因为 IE 自带的 JVM 并不支持 Swing,所以 XWT 没有使用 Swing。XWT 通过 XML-RPC 或者 SOAP 与服务器通信,获得需要显示的数据,因此你可以使用任何支持 XML-RPC 或者 SOAP 的技术做服务器端的开发。XWT 运行在一个严格的沙箱里面,不需要担心其会执行非法的操作。 
XWT 是两年多前建立的开源项目了,但是今天看来仍然是非常 cool 的。它的 ActiveX 版本是用 Java 写的,而且是用 gcj 编译为本地代码,并且可以通过 COM 接口来访问。XWT 的布局设计借鉴了很多 TeX 的设计思路。 

XWT 中采用了 JavaScript 作为其脚本语言。为什么要采用 JS 这里有详细的解释: 
http://kw.pm.org/talks/0103-xwt-kwpm.pdf 
Andrew Kohlsmith 写道: 
Yes, I mentioned JavaScript ? the bane of the Internet. I just about wrote off XWT when I realized that XWT is centered around JavaScript, and that I'd have to learn JavaScript. Having worked with it for just about a year now, I have to say that selecting JavaScript was an excellent move on Adam's part. It's not a tacked-on afterthought like how JavaScript is under (D)HTML ? it's a core part of XWT and is complex enough to handle practically anything a widget will need to do. It's simple and straightforward enough that you can take practically anybody who's done web development and give them some basic training on XWT and they'll find their way. 

在这篇文档里面作者还对 XWT、XUL、DOM、Flash、Swing、CURL 等等技术进行了有说服力的比较。 

XWT 相关的站点和资源: 
http://www.xwt.org 
http://sourceforge.net/projects/xwt/ 
http://www.xwt.org/faq.html 
http://kw.pm.org/talks/0103-xwt-kwpm.pdf 
http://xwt.sourceforge.net/sundevday/SunDevDay.pdf 

XWT 的总设计师是 Adam Megacz 
http://www.megacz.com 
这可是个牛人啊,看看他的简历: 
http://www.megacz.com/resume/resume.html 
他还是 gcc 和 gcj 编译器的开发人员之一。现在正在攻读他的 Ph.D 的学位。 

还有他的名人名言: 
Adam Megacz 写道: 
5.5 Yeah, but don't you have some pent-up highly political rant about Open Source, Microsoft, and how geeks are going to take over the world? 

If I haven't made it clear already, I don't get into the napoleonic aspects of open source. I use GNU/Linux/Apache/GCJ/Rhino because for my specific needs, they are undoubtedly the best tools available -- not because I think that commercial software is somehow impure or wrong. 

That said, I've always seen Microsoft, Startups, and Open Source as three snakes, each eating the next's tail. The Silicon Valley startups, driven by enlightened greed, come up with crazy, inventive new technologies. A few years later, Microsoft either buys out the startup or bundles a copy of its technology into the Windows Monopoly and puts the startup out of business. A few years after that, somebody completes an open source program with a crappy UI and a better implementation of all the features that Microsoft just finished bundling into the OS. And a few years after that, a new startup running out of a garage, strapped for cash, discovers that they can modify this cool open source program to do something new and interesting, or build on top of it, and they create a successful business. And then the cycle repeats itself. 

Like I said, quit whining and go write code. This is the way of the world; just keep the snakes moving and everybody gets cool new stuff. Got it? 
XWT 的设计灵感主要来自于 XUL。请看其 FAQ 中的内容: 
Adam 写道: 
1.3 What technologies inspired XWT? 

Mozilla's XUL/XPFE 
XWT was directly inspired by Mozilla's XUL technology, which lets you mark up a user interface using XML. I like to think of XWT as "XUL light with SOAP and XMLRPC", since it is much simpler and more lightweight than XUL, although it is less powerful than XUL since it lacks the ability to render arbitrary XML documents. A brief way of summarizing the differences would be that Mozilla/XUL sees GUIs as nothing more than a particular kind of document; XWT sees documents as nothing more than a particular kind of GUI. Conventional GUI frameworks see both as nothing more than a grid of pixels. 

Macromedia Flash 
While working for Reactivity, I did a contract for the now-defunct contact.com. We wrote a full-blown contact manager / address book entirely in Flash, which talked to a J2EE/Apache/Oracle server using HTTP POST (SOAP/XML-RPC were not yet mature). After leaving Reactivity, I spent a lot of time thinking about that project -- Flash was the best tool available for the job at the time, but yet was clearly far from ideal. I really wish that we had had XWT back then. 

TeX 
Donald Knuth's TeX was the first serious software typesetting solution, and its rendering model (hboxes and vboxes) shows unimaginable forethought. XWT's rendering model is directly based on TeX's. 

UNIX 
The UNIX model of "many small composable tools" was a major design influence; you could say that XWT's template data abstraction requirements are an attempt to impose the UNIX worldview the GUI design process. 

Others 
XWT's extensibility framework is patterned after Emacs'. The PalmOS mentality of "small and simple are good" was another strong influence. 
 

与 XWT 类似的开源技术还有很多,网上有很多这类技术的投票: 
http://xul.sourceforge.net/post/2003/12/poll_what_is_your_xul_motor_of_the_year_2003.html 
java_xul_toolkit_do_you_use_most.html">http://viva.sourceforge.net/republic/2004/02/poll_what_java_xul_toolkit_do_you_use_most.html 
java_xml_ui_toolkit_do_you_use_most.html">http://viva.sourceforge.net/republic/2004/07/poll_what_java_xml_ui_toolkit_do_you_use_most.html 

从这些投票中我们可以看到,技术发展到了今天,让我们彻底摆脱 HTML 的技术已经有很多了。XAML、XUL、Flash 只是其中得到巨大商业支持的三种,但是是否是最好的技术(我们这里最好还是从纯技术角度来把这些问题探讨清楚),则是个仁者见仁,智者见智的问题了。可以肯定的是:Web 表示层开发的最终出路是彻底抛弃那种笨拙的基于 HTML FORM 的请求/响应模式,以 XML 技术和 WebService 的体系架构为核心加以彻底改造。表示层的逻辑全部前推到浏览器端来运行。B/S 之间在不切换页面的时候,传输的全部是 XML 格式的纯数据。如果将来所有的 Web 表示层开发全部都基于 XML 技术改造后,建造一个智能程度更高的搜索引擎将不再是一件非常困难的事情。而这一技术发展方向正是几年前 W3C 的领头人 Tim Berners-Lee 所设想的 Semantic Web 蓝图中描述的情形。 
http://www.scientificamerican.com/2001/0501issue/0501berners-lee.html 
http://www.xml.com/pub/a/2001/03/21/timbl.html 
http://www.xml.com/pub/a/2001/03/07/buildingsw.html

这个东西有一个优点就是比较小,我就是特别喜欢小而精的东西。Laszlo 我下载过,有 100 多 M,感觉太大了。XAML 只能用在 M$ 的平台上,XUL 只能使用 Mozilla 内核。Flash 我不大清楚,XWT 开发人员 Andrew 对于 Flash 有这样的评价: 
Andrew 写道: 
Macromedia Flash ? The authoring tools need to be purchased. Creating reusable modular widgets is not easy to do in Flash. The widgets are not themeable, and the engine is only partially available and peripherally maintained under Linux. All in all, it's a proprietary system for creating dynamic graphics and presentations, not a robust structure for application development. 

其实和我的想法差不多。太复杂、限定于某一个平台、必须花钱购买开发工具和受限于私有的技术,这些至少在我看来或多或少都是问题(完全是个人喜好,可能其他人并不这样认为)。而 XWT 并不存在这些问题,在我看来还是很理想的。最重要的是,它现在就在手边,而且并不复杂,只要你有欲望,随时都可以把它用起来。 

我介绍 XWT 就是想说明:如果我们抛开商业因素,从纯技术的角度就事论事,其实在开源的世界里,小公司或者个人提供的解决方案也有很多是 viable 的,而且很可能在技术上是更加有趣的。其实这个 XWT 的设计是有非常多的独到之处的。所以我们除了讨论大厂的解决方案如 XAML、XUL、Flash 外,也不要忽略开源的天空中亮度虽然不高,但是依然闪烁着的这些很有特色的小星星。有些时候拿高倍望远镜看看它们也是蛮有趣的。
上一篇:AWT常用组件可以使用的监听器

下一篇:Swing 编程 LayoutManager 的应用

  • 选择jsp而不是servlet作为BS前台主流方案是JAVA的战略性方向错误
  • 关于cookie目录的总结(JSP和Servlet版本),
  • Java咖啡馆(6)——编写猜数字游戏
  • Java Servlet 和 JSP入门教程(4)
  • 一种新的设计方式
  • 根据petclinic项目手把手教你剖析SpringFramework源代码---准备篇
  • shark工作流文档翻译活动-SharkAdmin
  • Java异常处理
  • [XML学习笔记][3.1]通过JAXP使用SAX
  • 基于JavaMail的SearchTerm【自定义的邮件查找器】
  • Eclipse集成 Lomboz和JBoss开发J2EE
  • JavaBean1015
  • 认识JDBC 2.0中的高级数据类型
  • Java1.5新功能可变长方法参数-varargs
  • Struts 学习笔记2 -ActionServlet深入探讨
  • Apusic1.1.2安装过程中遇到的jdk相关问题解答
  • 会话bean的生命周期
  • 用J2ME的通用联网框架开发联网的应用程序
  • 返回】 【顶部】 【关闭
    Copyright © 2005-2010 www.594k.com All Rights Reserved.
    版权所有:JAVA学习网 备案序号:皖ICP备06004238号