Friday, June 27, 2008

What JavaScript libraries and frameworks are available?

There are many libraries/frameworks out there (and many more emerging) that will help abstract such things as all the nasty browser differences. Three good libraries are The Dojo Toolkit, Prototype, and DWR. 

The Dojo Toolkit contains APIs and widgets to support the development of rich web applications. Dojo contains an intelligent packaging system, UI effects, drag and drop APIs, widget APIs, event abstraction, client storage APIs, and AJAX interaction APIs. Dojo solves common usability issues such as support for dealing with the navigation such as the ability to detect the browser back button, the ability to support changes to the URL in the URL bar for bookmarking, and the ability to gracefully degrade when AJAX/JavaScript is not fully support on the client. Dojo is the Swiss Army Knife of JavaScript libraries. It provides the widest range of options in a single library and it does a very good job supporting new and older browsers. 

Prototype
focuses on AJAX interactions including a JavaScript AJAX object that contains a few objects to do basic tasks such as make a request, update a portion of a document, insert content into a document, and update a portion of a document periodically. Prototype JavaScript library contains a set of JavaScript objects for representing AJAX requests and contains utility functions for accessing in page components and DOM manipulations. Script.aculo.us and Rico are built on top of Prototype and provide UI effects, support for drag and drop, and include common JavaScript centric widgets. If you are just looking to support AJAX interactions and a few basic tasks Prototype is great. If you are looking for UI effects Rico and Script.aculo.us are good options. 

Yahoo UI Library is a utility library and set of widgets using the APIs to support rich clients. The utility library includes support for cross-browser AJAX interactions, animation, DOM scriptging support, drag and drop, and cross browser event support. The Yahoo UI Library is well documnented and contains many examples. 

DWR (Dynamic Web Remoting) is a client-side and server-side framework that focuses on allowing a developer to do RPC calls from client-side JavaScript to plain old Java objects in a Java Enterprise Edition web container. On the server side DWR uses a Servlet to interact with the Java objects and returns object representations of the Java objects or XML documents. DWR will be easy to get up and running and plays well with other Java technologies. If you are looking for a client-side and server-side framework that integrates well use DWR. 

Google Web Toolkit (GWT) is client/server framework provided by Google that allows a developer to write an AJAX application in pure Java. The GWT takes care of the details of generating all the client-side code using a Java-to-JavaScript compiler. One of the key benefits of the GWT Software Developer Kit (SDK) is that it allows you to debug your applications in what is known as GWT hosted mode using an embedded browser (IE on Windows and Mozilla/Gecko on Linux) that is tied to the toolkit. In GWT hosted mode you setup through the code and debug it as it is running on both the client and server. The GWT contains a default set of widgets and widget containers. An application is built by coding a set of widgets and containers together much like would be done in a Swing application. The GWT Software Developer Kit (SDK) is limited to Linux and Windows XP/2000 though the web applications it generates are compatible with the latest generation of the mainstream browsers. 

There are many new and emerging libraries for JavaScript and this list only reviews some of the more common libraries. When making a choice choose the library which suites your needs the best. While it might be better to choose one, there is nothing stopping you from using more than one framework. For a more extensive list of client-side frameworks see: Survey of AJAX/JavaScript Libraries.
What do I need to know to create my own AJAX functionality?

If you plan not to reuse and existing AJAX component here are some of the things you will need to know. 

Plan to learn Dynamic HTML (DHTML), the technology that is the foundation for AJAX. DHTML enables browser-base realtime interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS). 
JavaScript - JavaScript is a loosely typed object based scripting language supported by all major browsers and essential for AJAX interactions. JavaScript in a page is called when an event in a page occurs such as a page load, a mouse click, or a key press in a form element.
DOM - An API for accessing and manipulating structured documents. In most cases DOM represent the structure of XML and HTML documents. 
CSS - Allows you to define the presentation of a page such as fonts, colors, sizes, and positioning. CSS allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript.

Understanding the basic request/response nature of HTTP is also important. Many subtle bugs can result if you ignore the differences between the GET and OIst methods when configuring an XMLHttpRequest and HTTP response codes when processing callbacks. 

JavaScript is the client-side glue, in a sense. JavaScript is used to create the XMLHttpRequest Object and trigger the asynchronous call. JavaScript is used to parse the returned content. JavaScript is used to analyze the returned data and process returned messages. JavaScript is used to inject the new content into the HTML using the DOM API and to modify the CSS.

What is OpenAjax? 

OpenAjax represents the collection of technologies and approaches defined by the OpenAjax Alliance to promote open and interoperable Ajax-based Web technologies that in turn lead to long-term customer success with Ajax.

How OpenAjax Alliance is organized : 

1. Steering Committee --

The members of the OpenAjax Alliance elect representatives from seven companies to positions on the OpenAjax Alliance Steering Committee. The Steering Committee manages the affairs of the OpenAjax Alliance on behalf of its member organizations. Among other things, the Steering Committee has final approval on the creation of working groups and specifications. 

2. Working Groups --

The OpenAjax Alliance develops its Specifications and other published Material within Working Groups that are chartered and approved by its membership and Steering Committee. At this point, the alliance has the following Working Groups: 
Interoperability Working Group - This group is responsible for technical activities in the general area of Ajax runtime interoperability. The key products coming out of this group include documents that provide the detailed definition of OpenAjax Conformance, such as the Specification for the OpenAjax Hub, management of the OpenAjax Registry, and development of OpenAjax Best Practices. 

Marketing Working Group -

This group is responsible for the OpenAjax Alliance's communications, educational and promotional activities for fulfilling the Alliance's mission to accelerate customer success with Ajax, promote adoption of open and interoperable Ajax-based Web technologies, and help drive the future of the Ajax ecosystem. Among other things, this group produces the Alliance's white papers, oversees the development of its website, and drives the strategy, high-level definition and industry rollout of the term OpenAjax Conformance. 

IDE Working Group -

This group is developing metadata standards for Ajax libraries in order to facilitate the integration of Ajax libraries into Ajax developer tools (i.e., IDEs). 

Task Forces 

The OpenAjax Alliance establishes task forces to investigate possible areas of new activity. The task forces are informal groups of interested members who perform relevant research and then produce recommendations for future alliance activities. Sometimes task forces are promoted into formally chartered working groups.

At this time, there are six active task forces: 

Security Task Force, which is identifying key Ajax security issues and investigating related activities that the alliance might pursue ,

Mobile Ajax Task Force, which is investigating what OpenAjax Alliance might do to accelerate customer adoption and success with Ajax on mobile devices 

Production Ajax Management Task Force, which is investigating what OpenAjax Alliance might do to help vendors and customers in the area of runtime performance monitoring

Searchability Task Force, which will investigate how to make current application state within an Ajax application discoverable and usable to search engines, perhaps by standardizing on particular approaches to URL fragment identifiers or parameters.

Runtime Advocacy / Lobbying Task Force, which will attempt to recruit a critical mass of Ajax toolkits and investigate ways that OpenAjax Alliance might be able to play an advocacy role to accelerate browser improvements that make Ajax applications work better.


Mashup Widgets/Gadgets Task Force, which will investigate a common metadata standard for Ajax-based mashup components such that (ultimately) the developers of the mashup components will be able to write-once and have it run anywhere.


Data Science - 103 (Kapil Sharma)

Cloud Computing Basic:-  In this the PC is on service provider data center and secuirty maintenance and upgrades are done by the service pro...