views:

87

answers:

4

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.?

+2  A: 

Silverlight 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.

Jerry Coffin
Technically this statement is incorrect. :-) AJAX stands for Asynchronous Javascript And XML and covers the use of the DOM XMLHttpRequest API from JS to make asynchronous calls to the server that don't block the browser DOM tree. Silverlight does not use XMLHttpRequest, it uses the standard OS network APIs to make asynchronous requests. As such, Silverlight does not rely on the browser implementation of XMLHttpRequest.
Franci Penov
Well originally AJAX was strictly javascript and xml, but according to wikipedia the term doesn't necessarily require that: "Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous." It also states that javascript isn't necessarily the language that must be used. AJAX refers more to the technique of retrieving data without reloading an entire page
Davy8
Ajax as a term still denotes using the XMLHttpRequest API. The fact that it can be used from other languages or can transfer non-XML payload is irrelevant. Now, if you want to define Ajax as "the technique of making a network request using any API and carrying any payload", that's another story, but at that point, one could argue that any application using that runs on top of TCP/IP is Ajax. Heck, with that definition even the old BBS software from the mid-80s can be defined as Ajax. Seems a bit extreme to me... :-)
Franci Penov
+3  A: 

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).

Heinzi
+2  A: 

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.

Igor Zevaka
+1  A: 

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.

James