Silverlight, Ajax and the Rich Internet Application
SAN FRANCISCO -- In recent months Silverlight has emerged as a possible challenger both to Flash and to Ajax in the realm of Rich Internet Application development.
At The Ajax Experience in San Francisco last week, Matt Gibbs, a development manager at Microsoft, presented an overview of Silverlight, the company's framework for Rich Internet Application development, and offered a bit of a comparison between Silverlight and Ajax development.
To be able to successfully compete, we need to target Firefox [and] the Mac, and we have made good inroads into Opera.
Silverlight's selling point is that it is strives to be both platform- and browser-agnostic -- and that is something with which Ajax struggles.
"We have a renewed focus that is not all about Internet Explorer," Gibbs said. "To be able to successfully compete, we need to target Firefox [and] the Mac, and we have made good inroads into Opera."
It was also important for Microsoft to focus on creating a system that could operate in a sandbox in order to provide a high level of security, Gibbs said.
"We are going to find a set of standard capabilities and make them available without prompting the user," he continued, adding that there will be no "backdoor" that users can opt into to make an application do more than it is intended to do.
However, the Silverlight sandbox does, like an Ajax-enabled Web application, allow for some isolated storage on the client. This allows the applications to store some data on the client without going back to the server.
Silverlight and Ajax: Four differences
Throughout his talk Gibbs pointed out four distinct differences between Silverlight and Ajax development. (Additional insight on the Silverlight-Ajax relationship can be found in two blog posts by Microsoft program manager Dare Obasanjo -- What comes after Ajax? and Silverlight: AJAX is now an endangered species.)
Second, both Silverlight versions also make use of XAML, the Extensible Application Markup Language, which offers markup capabilities that target user interface creation and programmable object creation. Silverlight takes advantage of this through Canvas, an object type that represents the presentation layer and, thus, allows developers, artists and others to set up properties on a text block.
Canvas allows for a number of rich graphics effects like rotate, scale, skew, translate and matrix transforms. "You can still code it by hand, but I would not," Gibbs said.
Third, unlike Ajax but like Flash, Silverlight requires a browser plug-in. One of Microsoft's biggest challenges has been minimizing the download required to execute the Silverlight framework. The company currently has the Silverlight framework trimmed down to about 4 MB and aims to hold the line there while adding more features. Even at this size, Gibbs fears they are pushing a barrier that will be resisted by many developers: "We are working hard to make sure the install is fast and easy. We need to make sure we don't have some of the bloat as with the [client version of the] .NET Framework."
Microsoft is also working on a model where additional features, like Python support, can be added as a 300 KB download instead of a standard feature that is forced upon all Silverlight apps, Gibbs added.
Fourth, Silverlight offers cross-domain support for applications. This is different from the kinds of restrictions placed on most Ajax applications, which limit requests from applications to a single domain. Gibbs said Microsoft has set it up so developers can call services from any originating domain, not just the one from which you downloaded the system.
Silverlight and Ajax: Three similarities
That said, there are a few ways in which Silverlight and Ajax behave similarly.
First, Silverlight does not support synchronous calls, although a number of developers have asked for that, Gibbs said. Furthermore, he added, Microsoft does not plan to support synchronous calls, as they could hang the browser.
Second, it is possible for developers to take an existing Web application and enrich it with pieces of Silverlight, instead of rewriting everything in Silverlight.
Third, like Ajax, Silverlight poses some forward/backward integration problems, Gibbs noted. Microsoft is working to solve the problem that occurs when, for example, someone hits the Back button on the browser, only to discover an empty shopping cart.
Finally, since only five programmers, out of an audience of about 50, indicated that they were using Visual Studio, Gibbs that the Visual Studio Expression Edition is free, both for VS 2005 and VS 2008.