Ajax, Atlas and Avalon – Part 1


About: This is the first part in a series of posts about the present and future state of User Interface programming models and their applicability in various scenarios.


 


Hello Everyone,


 


This series of posts introduces the three programming models that in my opinion are going to occupy significant portion of current and future development in the world of user interfaces, I will start with the AJAX that is creating a lot of buzz in the industry these days:


 


What is AJAX?


 


Let me tell you what is AJAX is not, it is not a product, it is not a specification and it is not a standard. It is the name of the son of Telamon of Salamis who fought against Troy but even that is not relevant to our discussion. AJAX which stands for Asynchronous Javascript and XML is a programming approach that adds a layer of abstraction between the browser and the Web Server. This layer, also referred to as the AJAX engine, handles the browser requests on the client side and connects back to the web server asynchronously whenever required. The asynchronous nature of communications allows users to continue interacting with the application while the data is being fetched by the engine, allowing for better user experience.


 


What are the underlying technologies used by the AJAX style of programming?


 


Developing a Web Application using AJAX typically involves utilizing the following technologies, please note that this is not a strict set, for example, instead of using XML or XHTML, it is also possible to use HTML or plain text and instead of XMLHttpRequest an IFrame object maybe used, however most of the AJAX applications are developed using the following technologies


 



  1. XHTML and CSS – XHTML is an evolution of HTML; it looks very similar to HTML but is designed to work with XML which imposes some changes in the rules of writing the markup. Cascading Style Sheets (CSS) allows for defining how various elements should appear on a Web page, the most common usage of CSS is to provide a library of styles that are reused throughout a Web Site.
  2. DOM –Document Object Model (DOM) is an API for HTML and XML documents that allows  programmers to create and build documents, navigate their structure, and add, modify, or delete elements and content
  3. XMLHttpRequest object – The XMLHttpRequest object can be used to exchange data asynchronously with the Web Server. The object was originally developed by Microsoft and made available in Internet Explorer 5.0. Mozilla contributors implemented a compatible native version in Mozilla 1.0, Apple made it available in Safari 1.2 and others followed suit.
  4. JavaScript – JavaScript is NOT related to the Java programming language, it was not developed by Sun Microsystems and is not owned by them, JavaScript is not ‘Interpretive Java’ (that is an urban myth), it is called JavaScript so that everyone who knows it gets an opportunity to mention that is not related to Java J. Developed by Netscape, JavaScript is a dynamic scripting language supporting prototype based object construction; its most common use is to enable client side features like validations for web applications.

 


How does an AJAX-based application differs from traditional Web Applications?


 


In a traditional Web Application user interactions usually result in an HTTP request to the Web server which processes the request, potentially using other servers and database components, and returns the results to the user. While the Web Server is processing the request the user often sees a wait icon and is unable to interact with the UI, after the data has been received and rendered the user can continue with the application. In case of an AJAX-based application, an AJAX engine, often included as a hidden frame, handles all interaction with the user interface and with the Web Server. The client side features like validations, view changes etc. are processed without going back to the server, for interactions that require server calls, the data is fetched asynchronously without blocking the User Interface.


 


Can I implement AJAX style of programming in J2EE and .NET?


 


AJAX does not dictate and is not concerned with what happens after the request has been received by the web server, you can use the AJAX style of programming whether you are writing ASPs or JSPs. Microsoft has been using this style of programming (without calling it AJAX) for a number years for its Web applications like Outlook Web Access, and XMLHttpRequest was introduced by Microsoft in Internet Explorer 5.0, there are specific features in ASP.NET 2.0 (e.g. asynchronous callbacks) that make it easier to implement this style of programming, in addition, it was possible to do this years ago using Java Applets, so why the recent buzz? I think that it is primarily due to the release of a number of high profile sites (and some about to go to production this year) that are been based on this style of Web programming.


 


Pros and Cons of AJAX


 


AJAX is an improvement over the vanilla Web Applications, and yes I know that a lot of people (like myself) believe that it is a marketing brand for technologies that have been available and used for quiet sometime (by Microsoft, Sun and others) but lets leave that debate aside; I am excited that it is becoming more mainstream. AJAX adds user interactivity and is supported by a majority of browsers; however, it is still not capable of replacing the rich client features required for a number of scenarios. It is not easy to develop AJAX applications because of the plethora of technologies and the learning curve involved in gaining a level of expertise in each one of them. AJAX will not work if Javascript is disabled on the browser and if an intentional effort is not made around the style of coding, the code developed is not typically elegant and thus hard to maintain. Lastly, AJAX can also have a performance impact if e.g. XMLHttpRequest object is not designed and used carefully.


 


Conclusion


 


AJAX allows you to improve the user experience of web applications and is a viable style for a variety of scenarios, it is a technology that is gaining a lot of momentum but still has some short comings in terms of the ease of programming and the learning curve required to develop serious applications that are maintainable. In my future posts I would be exploring Atlas which is a Microsoft initiative to ease the pains of developing AJAX style web applications, and Avalon (windows presentation foundation) which is part of the Windows Vista and holds the promise to significantly improve the user experience in rich and smart client applications. I will also attempt to explore the scenarios where AJAX, Atlas and Avalon maybe used.


 


Part 2: http://blogs.msdn.com/mohammadakif/archive/2006/01/23/516425.aspx


Part 3: http://blogs.msdn.com/mohammadakif/archive/2006/01/29/519008.aspx

Comments (10)

  1. Good article and I’m really looking forward to your comments on Atlas. I wonder though whether Atlas will be more important to MS Office and Windows Live than to Vista. But I think that’s a question of how Microsoft decides it’s best "marketed."

  2. makif says:

    Thank you John, I appreciate your comments, in my opinion at least for the next few years (5+) both the Web and the rich/smart client models will remain very relevant to the industry. During that timeframe, based on the innovations in web and the desktop platform technologies maybe a clear winner will start emerging or both will continue to be viable models.

  3. My first memories of Ajax are from the time when I lived in Waco, Texas several years back. One of my…

  4. Nice article. Very clear and substantial.

    I am looking forward to your article on ATLAS and AVALON.

    In future, if you can support your article with some example or example links, it would be very beneficial.

    Thanks Mohammad Adil Akif for info.

  5. Wesley says:

    Just remember that Atlas is NOT Ajax. Since Atlas is NOT asynchronous(It would mess up the viewstate…)

    I’m looking forward to your next posts!

    Cheers,

    Wes

  6. tudor says:

    Good article about Ajax but I think it is a waste of time investing in Ajax or Atlas today, because starting with Vista arrival(later this year), the Winfx framework will allow for unprecedent productivity and rich presentation for desktop or web clients via its xaml and communications concept.

  7. wydok says:

    tudor mentioned that he felt investing in AJAX now is a waste of time because of work done in Vista.

    Not everyone will have Vista when it becomes avaiable, and even then, not everyone uses Windows.  HTML was invented to be cross-OS, and AJAX, which is supported by cross-OS browsers, will still be useful for MAC, *nix, and 95/98/XP users

  8. tudor says:

    1)winfx framework will also be available for windows xp and 2003 server so having a windows vista will not be mandatory. A scaled down version of winfx will be available for linux based systems also.

    2)Beeing a commercial applications developer i really dont care too much about 5% of people having *nix who will never buy a software anyways:).

    3)the winfx programming model is much much more robust and clearer when compared to ajax stuff.

    cheers