by Morgan McCullough
Before making the choice to use Silverlight or any other development tool, it is always important to examine the requirements and trade-offs.
Because Silverlight is a Web technology that allows the creation of rich Internet applications, it is positioned to offer many of the same benefits as a traditional Web application. The application can be centrally located and managed, and because it is accessible over the Web, can be used through corporate firewalls and does not require installation on client machines. Also, there is less need to move data around between disparate systems and a single interface can greatly simplify data access and security management. In general, Web applications are more manageable, highly deployable, easier to secure, and very often less expensive overall.
It is possible (but not yet proven) that a team already familiar with the Silverlight environment could produce an application more quickly than if they were using a traditional Web application development stack, especially since developers would not have to spend time addressing cross-browser differences.
In general, Silverlight offers four key capabilities above and beyond the traditional Web application.
1. Rich UI Experience
First, Silverlight is designed with high-level UI components in mind, which also means there are several UI component libraries offered by a variety of vendors, e.g. Infragistics and Telerik. These UI controls offer a powerful and rich user experience in a relatively easy-to-use package. In addition to common UI components like text boxes, combo boxes, and date pickers, there are a variety of complex multimedia controls, grid controls, mapping controls, charting controls, calendars, and even a rich text box that offers similar features to WordPad in Windows.
Bringing these same capabilities to an HTML Web application would be a daunting task. These controls also hook into the standard data validation capabilities that come as part of Silverlight. In the world of HTML Web applications there are various validation strategies, but they have to be implemented as part of the application development.
2. Greater Freedom for Creating Client-Side Logic
The Silverlight run-time executes application code in a security sandbox that only allows very limited privileges and does not have direct access to any user data or system-level operations. This could prove very valuable for large organizations that are subject to SOX compliance. Also, because Silverlight offers a complete run-time environment, there is an option to run your application completely outside the context of a browser, while still maintaining the ability to distribute it over the Web.
3. Integrated Development Environment
Silverlight offers a fully integrated development environment that should be relatively familiar to any .NET developer. Any .NET language can be used from back to front, but C# is the most common choice.
Also, the Silverlight UI itself is defined using an XML-based markup language, called XAML, which is the same technology used in the newest .NET UI framework, WPF. For obvious reasons, Silverlight does not offer full feature-parity with the WPF stack, but with careful structuring of an application, it would be theoretically possible to deploy both a Silverlight and a WPF application from the same code base.
Due to the integrated nature of the development environment it is also possible to utilize common server-side technologies like NHibernate or the Microsoft Entity Framework on the client through libraries like RIA Services. These libraries allow the Silverlight developer to directly utilize entity structures reflected down from the server. RIA services specifically creates a structure under which client-side interfaces and libraries are automatically created based on services defined on the server, which has the potential of greatly reducing development time.
4. Sophisticated Styling Capabilities
Silverlight provides powerful styling capabilities through the UI markup language XAML, and a tool called Expression Blend geared directly towards designers. This combination allows designers and developers to easily create any number of complicated layouts with sophisticated styling, including interactive animation elements—much of which would be challenging to create even with the features present in the new CSS 3 standard. Silverlight makes complicated layouts and interactive animations much easier to create without having to worry about cross-browser compatibility or force designers to dig into complicated HTML or CSS.
When making a final technology decision for Web applications, the ultimate answer is, as always, “it depends”. While Silverlight does present a compelling story for creating Line of Business applications, especially for companies already heavily invested in Microsoft technology, it is not necessarily always a good option. The fact that it requires a browser plug-in that is still nowhere near as ubiquitous as Flash does count against it. Also, its inherent complexity means it is definitely not intended for basic interactive websites.
Again, where Silverlight can really shine is in business application development scenarios where there is a known limited set of users and its client-side capabilities prove invaluable. However, it is still a maturing technology with its own weaknesses and foibles, and its feature set puts it square in competition with Adobe Flex. However, it is a welcome additional option in the world of Web technology. Examining the pitfalls of Silverlight development and comparing and contrasting its relative strengths and weaknesses will be the subject of a future article.