Nowadays, starting a web development poses a considerable challenge, since clients have got used to having powerful desktop-based interfaces at their disposal, which can also be delivered in record time. If we focus on Line of Business (LOB) applications, we find the additional challenge which is the fact that our apps have to be ready for massive changes, taking into account tight deadlines without sacrificing stability. All of us have suffered that "little last-minute change". Everybody has heard things like, "We got to change the way in which discounts for purchases are managed. This could be ready in just five minutes, couldn't it?"
To overcome such situations, web developers can make use of a combination of ASP.NET (webforms or MVC), HTML, JavaScript, AJAX, and the more advanced HTML 5 and jQuery.
Nevertheless, when we implement LOB applications we often find that:
We have to struggle in order to make our pages consistent in different browsers; even in different versions of the same browser.
Our developers have to learn a language to develop client side, and another one to develop the server side.
JavaScript is a polemic language—love it or hate it. For some developers it is not object-oriented (although it has OO capabilities) and is an interpreted language. One only has to forget to add a semicolon, or introduce a syntax error when typing a command, and our application may produce an execution time error.
HTML 5 only works in updated browsers. Could you imagine yourself telling your client something like, "Well, what you have to do is install the latest version of Chrome or IE on your 1,000 PCs. This is also applicable to your associate companies."
We have to mix business and presentation logic. We try to avoid going to the server, for instance, to make validations which do not require reading a database. That is to say, we mix the reading of an input or an HTML ComboBox with the realization of validations. For example, if the user chooses more than four high-end products and is a premium client, we can enable a special 10 percent discount. This causes serious trouble when changes are required in the page layout, even if they are insignificant.
Microsoft has published a plugin called Silverlight (the word plugin reminds us of Flash, one of the most accepted plugin-based technologies) which allows us to encode with sturdy, compiled languages (such as C# and VB.NET). This plugin incorporates a lite version, that is the .NET Framework, which offers us the possibility to take advantage of everything offered at the client side while implementing a new markup language called XAML. The advantages of using Silverlight are as follows:
Our applications are sturdier; for example, allowing us to implement automatic unit testing at the client side.
We can decouple business presentation and implement an architecture at the client side.
We can decouple roles. While a designer can deal with presentation, we as developers are able to focus on the business of building the application.
Our application is more scalable (we free up resources on the server) and we do not depend on tricks to maintain application status.
We can have a standard XAML implemented the same way in every single browser. No more headaches such as, "it looks good in IE6 but not in IE7, or Firefox, and so on".
In addition, Silverlight is multi-platform (for example, Windows or Mac) and multi-device (computers, mobile devices with Symbian or WP7 support, for instance, among others).
In this book, we are going to deal with Silverlight 5. The tool that Microsoft recommends for development is Visual Studio 2010. Therefore, we will have to install the following software:
Visual Studio 2010 (if you do not have a commercial license, you can download the express version available at http://www.microsoft.com/express/downloads/#2010-Visual-CS)
Visual Studio 2010 SP1 at http://www.microsoft.com/download/en/details.aspx?id=23691
Microsoft Silverlight 5 Tools for Visual Studio 2010 at http://www.microsoft.com/download/en/details.aspx?id=23887
All of these individual links are available at http://www.silverlight.NET/getstarted/.