Next Gen Offline Capable Web Apps with HTML & Java Script Dion Almaer & Ben Galbraith

为公司一个新产品做架构设计,本来想采用smart client,但最近接触到较多的BI产品,发现很多已经可以在browser上实现rich client的大部分的功能,弄得jeet现在还在采用B/S还是smart client之间摇摆。今天在therserverside上看到这篇文章,转过来供大家参考,也欢迎大家发表意见

Ben and Dion teamed up to show us what’s new and cool on the client side, dispelling the myth that compelling rich user interfaces cannot be delivered with current browser technology. Rich Client technologies include HTML, Java Script, Applets, Flash, and SVG. This set of technologies is now being referred to as Ajax; a framework for building rich UIs. These technologies have been around for a long time. Now there are improvements and new features that make rich clients worth another look. Most notably: DOM and XMLHttpRequests.

Ajax relies upon the XMLHttpRequest object, which was first introduced in Internet Explorer. Opera, Safari and Mozilla have all now implemented a version of XMLHttpRequest that is accessible to JavaScript. A standard is also in the works from the W3C. Although there are some differences in the implementation of XmlHttpRequest (the IE version is an ActiveX control), the Ajax framework abstracts away the differences and provides a unified API.
Java Script / DHTML have been plagued by browser incompatibility and poor debugging tools. In the past, the most common method of writing Java Script was to write two versions of the same code; one version for IE and one version for Netscape. This code is generally intermixed with frequent browser type checks. Java Script tends to be painful and most Java developers prefer to avoid it. Several members of the audience expressed great contempt for Java Script.

With the latest browsers, improvements have been made to write browser compatible Java Script. This is done using the Document Object Model (DOM) API. A lot of developers, including Ben are not happy with the DOM API. It is clunky and non-intuitive, but everyone who works with XML knows it well; so it is a good fit for Java Script. In the tool space, IE needs a better solution than the current script debugger. The script debugger in Mozilla is much better, but better tools are needed.

XMLHttpRequests allow Java Script to make remote calls and dynamically update page data without having to do a full page refresh. The key benefit of asynchronous requests is the ability to process a user request or update the page without requiring a full rebuild of the page. This helps reduce the load at the server as the need to repeat potentially expensive operations such as loading data from a database can be avoided. For example, a user could enter their zip code and an XMLHttpRequest can be used to retrieve and populate city and state fields. According to Matt Raible’s blog, XMLHttpRequests have been around for a few years and most folks just didn’t know about it. I’m in that “didn’t know about it” group. So who uses this? Google Maps, Google Suggest, and Ta-Da List.

The presentation concluded with a look at a modified version of the RSS reader demon that cached the feeds locally to allow them to be read offline. Dion explained that this could be taken a stage further if signed scripts were used to enable data to be read and written tothe client's local drive. This app will be available on their new site: http://www.ajaxian.com

.

.
原文地址:https://www.cnblogs.com/jeet/p/123979.html