18 October 2012

Post-Silverlight remarks

    After spending a year and a half in XAML land using Silverlight extensively I leave with pleasant memories but also with a bitter feeling.

    The main strength of Silverlight is creating complex applications for Windows/Mac OS X with ease while maintaining a low deployment footprint. Silverlight XAML is almost identical with WPF XAML minus a couple of features and this versatility seems to make Silverlight an essential tool for the enterprise application developer. But since Microsoft abruptly shifted focus from Silverlight to HTML5 in 2011 the Silverlight open source ecosystem has imploded rapidly.


    Recently AutoMapper has dropped support for Silverlight (version 2.0 is the last version that supports Silverlight) and I took this rather lightly to begin with knowing that the library is mature and  very popular. But soon I discovered that when open source libraries like AutoMapper abandon Silverlight it affects other open source projects too. I found this worrying fact when I was working on adding AutoFixture support for Silverlight 4. Thanks to some previous attempts to accomplish the same feature I was able to modify and compile the AutoFixture assembly for Silverlight. But when I tried to make the tests pass for the new assembly(and after getting Resharper to run the xUnit tests for Silverlight) I discovered that some tests were failing. The failed tests were for a bit of code that I had to change to cater for .NET classes and methods that are not available in Silverlight. And this bit of code was originally taken from the AutoMapper source code which now has dropped support for Silverlight: I have problems modifying an open source library to support Silverlight while the other open source library that tried to address similar problems has dropped support for Silverlight.

    I can investigate other solutions - maybe the Moonlight project(Silverlight for Linux) could offer some relief ... but this project was recently abandoned as well. I should continue looking to find an open source project that tries to solve a similar issue but it feels like I am trying to build on an eroding structure. I think this also affects commercial projects as open source projects are facilitating or providing missing features for the Silverlight toolchain - xUnit, ReSharper unit testing, REST clients.

    Other parting thoughts are that Silverlight done properly via MVVM and unit testing offers a good model for the emerging enterprise applications that are based on JavaScript, HTML and CSS. It is a very good benchmark for any framework that aims to replace it and it helped me grasp how a rich and complex JavaScript web application should be like.

No comments: