Geeks With Blogs

News

Google My Blog


Murray Gordon Flash a-ah! Savior of the universe...

AJAX

Though it’s simply a combination of relatively mature technologies, AJAX, or Asynchronous JavaScript and XML, is emerging as a popular industry solution that allows developers to combine existing web technologies to create highly interactive and responsive web interfaces. AJAX as a technology has been around for quite some time, it is the name that is new.  Microsoft’s Outlook Web Access is a good example of the technology in use, before it had a name.  The name AJAX was coined by Adaptive Path in early 2005 (here's the original content on AJAX http://adaptivepath.com/publications/essays/archives/000385.php).  This simple acronym, combined with the highly visible implementation of the technology by Google (maps.google.com), has put a spotlight on AJAX.  Also known as Out-Of-Band Callback, Asynchronous Callbacks or Load-On-Demand, AJAX can be a powerful tool in any Web developer’s arsenal.

The basic idea of AJAX is to open up a new line of communication between the client and server, where data can be transferred asynchronously, usually as XML.  Since the data transfer is asynchronous, the UI on the page does not have to ‘wait’ for the transfer to complete.  This allows the end user to continue to use the page as normal, while bytes are being transferred in the background.   The combination of the client-side power of JavaScript and the structured data capabilities of XML give Web developers the ability to communicate with a Web server without having to incur the expense of a complete page postback.

AJAX

Once the response is received by the browser, the developer is free to use and manipulate the data as needed. A frequent example of this is using client-side JavaScript to combine the XML results returned by the web server with DHTML to alter what the end user sees in the browser.

Why AJAX is Important

In today’s Internet world, speed is a key ingredient to building a successful presentation layer of your application.  In addition, Web applications are becoming more complex, and in many cases require loading large amounts of data.  Because AJAX allows you to split up your page into smaller portions of information that can be loaded and manipulated separately (without the need to reload the entire Webpage) end users are seamlessly receiving larger amounts of information and more robust pages. This is important because it provides the end user with a more familiar Windows – like, rich experience, without the very noticeable interruptions caused by postbacks.

“Atlas”

It has become common knowledge in Web development that the most powerful tool for creating rich behaviors in a Web Application is JavaScript.  Since the first Infragistics release for ASP.NET back in 2002, JavaScript has been used in combination with CSS, to provide the full featured client-side functionality found in the Infragistics tools.  Microsoft’s client-side framework, code named “Atlas”, not only provides a solid foundation for creating rich client-side behaviors but also simplifies AJAX programming in general.

When talking about AJAX programming, there are generally two concepts that can be employed.  One concept is to use a container or wrapper, which will turn a normal PostBack into an AJAX Callback.  The wrapper is used to provide generic AJAX behaviors to any control which is placed inside of it.  Wrappers are perfect for scenarios where a group of controls require to be updated as a unit.  Wrappers are also used in instances where a control itself does not have AJAX capabilities.  In “Atlas”, the UpdatePanel is a wrapper, making it ideal for use in the scenarios described above.

In certain instances it also makes sense to build AJAX functionality directly into a specific control, instead of using a wrapper.  An example of this is a LoadOnDemand feature such as that seen in the Infragistics WebTree, or WebGrid.  In a load on demand scenario it is not necessary to update the entire control, as we are only interested in getting the ‘missing’ data.  To best serve this scenario, the control will automatically request only the missing data, inserting it directly into the existing HTML.  This technique allows you to leverage AJAX behaviors simply by setting properties on the control at design-time.  With AJAX functionality built into the control at the feature level, you end up all of the benefits of AJAX, without having to write a single line of JavaScript.  We like to refer to this technique as “No Touch Ajax”.  For .net developers, there are libraries that exist that make AJAX easier and more intuitive. Check out ajaxpro.info for an XMLHttpRequest wrapper that allows you to pass actual .net objects instead of raw xml between client and server. Atlas also allows cross domain calls, that is how Where's Tim talks to weatherbug, yahoo traffic, flickr and all the other web API's.

Future Impacts

The sudden popularity of AJAX in the developer community has made it clear that this technology is ready for mainstream use.  Each day, another clever use of this asynchronous communication pops up. 

I hope you find this information helpful. AJAX is an exciting technology and worth the research from any .NET web developer. 

Thanks,
Murray

p.s. Thanks to Tony Lombardo, from Infragistics for this awesome content. If you want to see the original article please check out the following link http://www.infragistics.com/resource/Technologies/AJAX/Default.aspx. I removed I lot of the Infragistics specific jargon. Also added Tim Hibbards comments and links to specific explanations of the technologies.

References:

Wikipedia (http://www.wikipedia.org)
Infragistics WebSite (http://www.infragistics.com/resource/Technologies/AJAX/Default.aspx)
Ayman Farouk's Blog (http://geekswithblogs.net/aymanfm/archive/2006/02/04/68194.aspx)
Microsoft's Atlas Website (http://atlas.asp.net/Default.aspx?tabid=47)
Adaptive Path (http://adaptivepath.com/publications/essays/archives/000385.php)
 

 

 

Posted on Thursday, September 28, 2006 11:36 AM General | Back to top


Comments on this post: AJAX - the what, the why, atlas, and the future

# re: AJAX - the what, the why, atlas, and the future
Requesting Gravatar...
For .net developers, there are libraries that exist that make AJAX easier and more intuitive. Check out ajaxpro.info for an XMLHttpRequest wrapper that allows you to pass actual .net objects instead of raw xml between client and server.
Left by Tim Hibbard on Sep 28, 2006 12:02 PM

# re: AJAX - the what, the why, atlas, and the future
Requesting Gravatar...
It also allows cross domain calls, that is how Where's Tim talks to weatherbug, yahoo traffic, flickr and all the other web API's
Left by Tim Hibbard on Sep 28, 2006 12:04 PM

Your comment:
 (will show your gravatar)


Copyright © Murray Gordon | Powered by: GeeksWithBlogs.net