Silverlight 3: closer to what client-side .NET should have been
Microsoft cranks it against Adobe
Behind the scenes
What of Silverlight itself? New features include a Bitmap API, 3D perspective transforms, and ClearType text, promising to end problems with blurry text, though it falls short of the elegant Text Layout framework in Flash 10. The Pixel Shader API lets you add effects to visual elements. On the web services side, binary XML offers more efficient transmission of data. There are new data-oriented controls including a DataGrid, DataForm, DataPager, TreeView and built-in form validation.
.NET RIA Services is a server-side piece for ASP.NET. On the server, you define one or more DomainService classes, representing your data and typically hooking into the ADO.NET Data Services object-relational mapper. RIA Services generate matching DomainContext classes on the client, giving Silverlight access to operations such as querying and saving data. When data is updated on the client, the changed are tracked, and sent back as a changeset after a call to SubmitChanges. This succeeds or fails as a unit, providing a kind of transaction support. RIA Services also support authentication, based on the ASP.NET Membership Provider framework.
Although .NET RIA Services provide valuable features, they are currently a Community Technology Preview, and Microsoft warns of significant changes to come, so they are currently aimed at brave or experimental developers.
Silverlight applications can now run offline and out of the browser, sometimes known as SLOOB - or Silverlight Out Of Browser. The mechanism is simple. The developer checks a box and adds some desktop icons, following which the user can install the application by right-clicking a Silverlight applet.
Define an out-of-browser application using Visual Studio
Despite obvious parallels, Microsoft's approach is distinct from Adobe's AIR. Even out of the browser, Silverlight applications have no access to local resources other than isolated application storage. Developers can detect the state of the network and code for offline use, but without any equivalent to AIR's local database engine.
A Silverlight application cannot appear in the notification area and cannot call web services unless they are marked to allow cross-domain access. Twitter is a well-known case that does not. Another Silverlight limitation versus AIR is that there is no WebKit to render HTML; your app has to be pure Silverlight.
The gain here is that a SLOOB requires no elevated permissions. Guthrie says this was a customer request. "Unless you are a top 20 site, customers won't install anything that is full trust," he told a .NET user group last week. Despite limitations, a SLOOB is a convenient means of running an applet without first navigating to a web page. Guthrie says that future versions are likely to have more options for extending the sandbox.
Silverlight 3.0 has plugged many gaps that existed in past versions of the player, but not all. There is no rich text editor, while access to local devices such as webcams, microphones, bar code readers or printers is weak.
Microsoft says it is working on all these things, which at the current rate of progress one can easily believe. That still leaves the question: is Silverlight really necessary, given that we have Flash, Java and AJAX, all of which have better cross-platform credentials and broader support?
The answer is that Silverlight makes great sense for Microsoft-platform sites aiming to visualize data, take .NET applications cross-platform, or extend web applications in ways that are difficult using AJAX. Tool support is not quite there, but once Blend 3.0 and Visual Studio 2010 are available, the company will have a great end-to-end RIA story.
The attraction for those outside the Microsoft camp is less clear. The development tools may be better, but SketchFlow aside, Adobe's Creative Suite is in a league of its own for designers.
Silverlight adoption is growing, with riastats.com reporting around 30 per cent installed base of active browsers, rising to over 40 per cent in certain counties such as the UK. That is a 50 per cent increase since March. On the other hand, Flash is more than 95 per cent, and Google even named Adobe a partner for its forthcoming Chrome OS. On mobile devices, Silverlight has yet to get started.
Despite these reservations, Silverlight is shaping up to be what client-side .NET should have been from the beginning: lightweight, high-performance, cross-platform, and supported by a rich GUI framework that takes a sane approach to layout. There is room for this alongside Flash. ®
Sponsored: Are DLP and DTP still an issue?