Next Gen Off-line Capable Web Apps with HTML & Java Script – Dion Almaer & Ben Galbrai

來源:互聯網
上載者:User

為公司一個新產品做架構設計,本來想採用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

.

.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.