AJAX is a part of RIA, that has been heating up for some time now. Even though with newer and more richer technologies coming up like Flex, Silverlight, AJAX still remains the most commonly used option. I attended a workshop on AJAX today which had the participation was from a set of Senior Developers and Technical Architects who have been either working on AJAX or plan to use that. Below is a brief summary of the workshop.
1. Compare AJAX with web 1.0
2, AJAX fundamentals
3. XHR and its role in AJAX
- AJAX and Web 1.0
5. AJAX frameworks – DWR, GWT, RICO and YUI
6. Technical aspects of AJAX in a project
- Conventions Web applications handle data and presentation together and hence that leads to slower bandwidth
- Faster response time is now desired
- Enhanced Usability – moving close to Rich Internet Applications
- Trying to do “Mashups” – bringing various Services together and bring in some meaning to the data
In the past, Sun proposed to use Applets for any kind of RIA stuff, but did not kick-off. Macromedia came up with ActionScript that can be used to create Flash files and help you more interactive content. Moving from a proprietary language to Open Source and more recently Flex is how Adobe acquired Macromedia bring this to developers. DHTML with IFrames was another option – but again is “more of a hack”, and is mostly suited for client-side richness.
Next up was a quick demo of using the XHR object in a JSP and the intent was to show how we can use well constructed HTML v/s XML and then rendering the same on the client.
It was shared that RSH that supports the history with the browser. To understand the very basic, we need to change the browser URL on every request. But, that is something that we do no et out of the box. Some custom code has to be written. This is one way of talking to the browser, but we also need to write listeners for the changes to the browser URL. This way, we can communicate to back and forth to/with the browser. Looking quickly at the RSH library, it seems like a good starting point.
- Increased complexity on Server as well as client
- XHR is not yet standardized by W3C
- Backward compatibility with some of the older browsers
Web 2.0 is about creating applications which can be integrated with other applications such that users can use data in a anyway they want to view and use it. Web 2.0 application can be one that makes use of data from other applications which offer data as service and simply provide you a combination of all such services. In other words Web 1.0 was “I will create something and then provide that to the user”, while Web 2.0 talks about “I will create a service that someone else can offer to their customers”.
Challenges of writing RIA applications
- How much code for working with XHR requests
- How many clients do we need to handle
- What is the data-format that we need to work with
- Exposing Business Logic to the client
Hence we need to choose a Framework!! – we have way too many @Ajaxian.com. A framework needs to worry about:
- Server side – What kinds of clients do we need to handle
- JSF, DWR, GWT etc
- Network – How many kinds of clients do you need to provide service to
- Jason, XML, SOAP, RSS
- Client side – Need to deal with the data and provide that richness to the client
- DOJO, YahooUI, script.aculo.us, RICO
A survey was conducted in 2006, that shows what various AJAX libraries were being used
Focus on Server side of an AJAX application
Deep dive on DWR or Direct Web Reporting
- Is a Java based technology to handle client-based AJAX requests
- Exposes the Java object as Stubs on the client. You can then make calls to the stub and get data from Server
- Has the capability to expose all the functions of an Object on the client
- Takes care of the Server side aspects like using the same POJOs and passing on to the client. The Client can then handle the objects as they feel like
- Offers integration with existing frameworks like Struts and Spring
There were a few more things, but not so much that I can write about. Hope you find this article useful.