AJAX is the big thing...but it seems (to me) that with Silverlight 4 Microsoft has offered a really robust method for creating UI interfaces for the web. I'm wondering - what is the future of AJAX? Do AJAX and Silverlight complement each other or will Silverlight replace AJAX, etc.?
views:
87answers:
4Silverlight uses AJAX. AJAX is a single piece that supports one part of what Silverlight does.
It (AJAX) helps a lot in maintaining responsiveness (lets Javascript in the browser make a function call to the server, but continue doing other things until the server responds), but by itself it's not much more than that.
Silverlight is a (fairly) complete framework for specifying and using a UI, and (when needed) it uses AJAX to keep the UI responsive while it's waiting for data from the server.
AJAX and Silverlight complement each other, just as AJAX and Flash complement each other. They are different technologies for similar (but still different) problems, both with advantages and disadvantages (Silverlight allows for richer user interfaces but requires a client-side installation, just to name the most obvious advantage and downside).
Silverlight and AJAX are different tools for different jobs. Before I go any further, let me just clarify what I mean by AJAX in this context. AJAX is a way to build rich browser based application by using Javascript, HTML and CSS without relying on other browser extensions.
Before HTML5 features started leaking into major browsers the gap in functionality was quite wide, but with native browser video and canvas rendering, it is not quite the case.
- Silverlight is still a richer framework to work with and offers different sandboxing models to allow less restricted access to the computer.
- Another advantage is that the C# code is compiled and thus has the potential to be faster. Again, this is less of an issue now with Javascript runtime getting faster and faster.
- Because the layout system will be the same on all browsers you can give a better experience guarantee. You won't need to spend hours debugging a 10px alignment issue between different browsers.
That said, in developing a web app I would try to get away with AJAX as much as I can. It's pretty powerful and you can achieve very rich functionality without requiring a plugin. If your application is a standard line of business app, then I, as a user, will probably get angry with you if you made me install a plugin just to show me some grids and buttons and forms.
Choosing how to develop and deploy your web app is becoming increasingly difficult these days. With the advent of mobile platforms, you have to tread very carefully. Sticking to HTML5 seems the best option so far, knowing that iPhone and iPad will never support Silverlight. Similarly I doubt Android and ChromeOS will do so in near future.
As with most web based technologies the answer is completely dependent on your audience.
If you build an app using AJAX it will work for the widest possible audience but there will be limitations on the control you have over the user experience (love those Silverlight storyboards).
If you use Silverlight the user has to have a browser and device that supports SL and the plugin must also be installed. This immediately eliminates the iPhone and iPad for instance but makes SL very compelling for an internal application for a large corporate where the desktop SOE is controlled.
Of course you could mix AJAX and Silverlight and have the worst of both worlds. I tried this once in a non-trivial app and it was a bit like translating a book into alternating chapters of Hebrew and Spanish.