Over a million developers have joined DZone.

.NET Fireside Chats - Laurent Bugnion on 'Silverlight 2 Unleashed'


DZone recently had an opportunity to sit down with Laurent Bugnion, author of 'Silverlight 2 Unleashed'.  In this interview, Laurent discusses the origins and future of Microsoft's Silverlight platform and some best practices for Silverlight developers to follow when doing RIA design and development.

DZone has also made available chapter 1 from Laurent's book, which can be downloaded here.


DZone - Tell us a little about what you do at IdentityMine?
Laurent Bugnion - I started on the 1st of December 2008 at IdentityMine Switzerland, a new branch of this Tacoma/Seattle firm. The Swiss branch is based in Zurich, Switzerland, and will be active in whole of Europe. I am the very first European employee but we are hoping to expand later.

My exact title is “Senior User Experience Developer”, which means that I am a developer with a strong taste for user experience and graphics design (though I am *not* a designer!). My role is positioned between graphics designers and “hardcore” software developers. It is a coordinator and communicator role, sometimes named an “Integrator”. Of course I also continue to do a lot of software design, architecture and development in various domains such as Silverlight, Windows Presentation Foundation and I remain a developer at heart. I should also start developing soon for the Surface platform and Windows 7.

DZone - What motivated you to write this book?
Laurent - I started my blog (http://blog.galasoft.ch) in 2006 because I found this a great way to communicate with the .NET community. I have always been very active in the programming community, back in my Java days, then  in the JavaScript community on newsgroups. Doing the blog was just a logical continuation, even though I started quite late compared to other well known developers. The editor (Sams) contacted me through my blog and asked me if I wanted to write a book, because apparently they liked my writing style and thought I could bring something good. I hesitated for a bit, because I was a bit afraid of the amount of work it means (I have two daughters, 5 and 7, whom I like to spend time with too ;)). It was in fact not my first experience in the writing world, I had been tech reviewing the French translation of “JavaScript, the Definitive Guide” a few years ago. Eventually I decided to accept the offer, and never looked back (and I am really glad I did it, even thought the amount of work was, indeed, huge).

DZone - What is Silverlight (and how does it differ from WPF)? Give us the nickel tour.
Laurent - Silverlight is in fact more than a “lightweight version of WPF”. It would be more accurate to describe it as a “lightweight version of .NET”. It is a 4 MB plug-in, designed to run on multiple browsers in multiple operating systems, and offering the .NET experience directly inside the web browser. For the developer, it is the occasion for the very first time to use well known APIs and tools (Visual Studio, Expression Blend, etc…) to create code according to the same principles and with the same skills they have been using for years. Of course some classes and methods are missing, in order to keep the runtime small. But all the APIs that are implemented are extremely (though at this time not 100%) compatible with the “full .NET” version. Because Silverlight is much faster than JavaScript, and because it reuses principles proven in WPF (such as separation of behavior and presentation, usage of XAML to improve the designer/developer workflows, etc…), Silverlight can be used to create a much better user experience. But as mentioned, it’s not “just that”, and Silverlight is also great for cient-server communication, for instance, for advanced calculations, for multi-threaded operations, etc…

DZone - What are some of the hardest problems that developers are trying to solve when it comes to user experience on the web?
Laurent - There are many challenges in web development, and probably the most annoying one is that web platforms are very heterogeneous. I think all web developers have been confronted to the need to test web applications in multiple environments because of small (or big) differences in the implementation of the HTML, JavaScript and CSS engines. When a JavaScript API, for instance, is developed, the amount of hours needed to test (even if we concentrate on only the major platforms) is huge. This I why 3rd party frameworks such as jQuery encounter such a success. Another challenge is that HTTP and HTML were not developed for web applications and clearly show their limitations more and more. The protocols are rather slow, text oriented and based on a request/response mechanism which often forces the developer to use workarounds to create responsive applications. Note that even with these limitations, it is pretty amazing to see what web applications can be created. But I am a firm believer that the web is going to eventually evolve outside of the web browser, and that we will see an increasing number of connected rich application, be it with Silverlight, Flash, AIR, or of course Windows Presentation Foundation (as ClickOnce applications, for example).

DZone - What kinds of features are available in Silverlight 2 as compared to Silverlight 1?
Laurent - Silverlight 1 was really not much more than a fancy video viewer. It was programmed with the JavaScript language only (no .NET support), and had virtually no controls (except TextBlock and some primitives allowing you to draw your own). It was a very basic platform, not much more than a proof of concept to be honest. But it was fun J Silverlight 2, on the other hand, is a full featured platform, with a rich controls ecosystem, a very rich .NET API, support for multiple programming languages (C#, VB.NET, IronPython, IronRuby…), a very rich communication platform (allowing web service calls through proxies to WCF and ASMX  web services, REST calls, uploads and downloads of any kind of files, calls to 3rd party web servers, etc…), a rich data access API (with LINQ to XML and LINQ to JSON amongst others)… ok I need a new word for “rich”.

DZone - Have you heard what kinds of new features are in the works for Silverlight 3? What features would be at the top of your Wish List?

Laurent - Yes, I am lucky to be part of a group of community experts called the “Silverlight Insiders” that is kept informed of new developments in the Silverlight platform. To belong to this group, I had to sign a Non Disclosure Agreements, for reasons that are easy to understand, so I cannot really comment much on the new features… except for saying that exciting times are ahead and that more will be disclosed at MIX09 (Microsoft’s web conference in Las Vegas, in March). Scott Guthrie publicly commented on some of the upcoming features, such as some kind of hardware accelerations, some 3D support, and many others.

On top of my wish list, I would place a greater compatibility with Windows Presentation Foundation. I think that one of the key reasons why Silverlight is going to be successful is the re-use of skills between the richer desktop client application platform, and the slicker and smaller web client application platform. Every step that is made in the direction of an even greater compatibility is making me happy.

All in all, I am very pleased with the direction that Silverlight is taking.

DZone - Explain the difference between what can be done in Expression Blend vs. Visual Studio when creating a Silverlight application.
Laurent - Well first it is worth explaining that Expression Blend is not strictly needed to create Silverlight applications. You can develop a full featured application in Studio. However, the visual design part is going to be harder, because there is no visual designer support in Visual Studio yet for Silverlight. There is a “viewer” that lets you see the result of what you code in XAML, but that’s it in this version (note that there is a visual designer for WPF that lets you visually edit the user interface).

Blend is however more powerful when it comes to designing the user interface. First, it was created with the designers in mind. Most commands are the same, or heavily inspired, as in Adobe PhotoShop or Illustrator, for example. In fact, this gave Blend kind of a bad reputation in the developer community, because many developers are a little afraid of this unusual application. But once you get over this first weird feeling, you’ll discover that it is a very rich application that can teach you a lot about design, about WPF and Silverlight. In fact, I really recommend taking an online class or hands-on lab to learn Expression Blend and even Expression Design.

So yes, Blend is about design of your application, and Visual Studio is about coding. But since Blend can compile code, you can in fact run the application directly from Blend. That said, while you can create an application only with Visual Studio and without Blend, this is not possible with Blend only. You will need some kind of source code editor, and I recommend Visual Studio for this purpose. Remember that the Express Edition of Visual Studio Web is free, and lets you create Silverlight applications, just like the Express edition of Visual C# lets you do this for WPF. So you can start at virtually no cost.

DZone - Are there any best practices people can follow?
Laurent - The best practices for Silverlight are, in essence, the same as the one applied to Windows Presentation Foundation, with a twist. The twist is due to fact that WPF is a richer platform, and not everything is available.

The very first thing that comes to mind is the recommendation to clearly separate the presentation layer from the rest of the application. Also, this layer should be kept as thin as possible. This can be achievd by using rge so called “Model-View-ViewModel” pattern (MVVM), which is very similar to the better known Presentation pattern. If it is applied consistently and carefully, this pattern allows reducing the code in the presentation layer to a minimum (so we will have mostly XAML there). This improves testability, makes it easier to maintain, and makes the work in Expression Blend much easier, for example by allowing to create design-time data very easily. Using this pattern, you can develop a whole client application without needing to connect to the web services. The integration step can be done only later. In addition, it allows designers and developers to work on the same application at the same time.

Other best practices are really the standard ones used in .NET: Unit tests (including a really nice unit test framework especially made for Silverlight), layering, etc… Programming Silverlight is really about applying what you already know in .NET.

DZone - Are there any interesting case studies that you can discuss? Have you implemented a recent project using Silverlight?
Laurent - In my past position, I was working on a very big WPF project, and came to Silverlight on my free time. The transition from WPF to Silverlight was really easy, especially because I had prior experience with web applications, so it really all fit well together. I wrote Silverlight 2 Unleashed on my free time as well. The big WPF application we did at the time was really big, and applying the principles of MVVM pattern, separation of behavior and presentation, components, etc… really helped us in the project.

Now at IdentityMine I will also do Silverlight projects for a living, but it’s still to early to talk about that.

DZone - Who should buy your book?
Laurent - From the start, I had in mind to make a book helping and guiding people with virtually no experience in programming, especially with .NET. This is the strategy we followed with the editor. Silverlight lowers the threshold to application programming, just like web technologies lowered the threshold to programming in general (with JavaScript). However, with Silverlight we have a real chance to evangelize and teach a “real” framework to beginners. I also wanted to target people coming from the Adobe Flash world, and let them understand the differences that Silverlight offers. I am very strongly convinced that Silverlight is very complementary to Flash, and that it doesn’t make sense to oppose them. These times are over. So my book can really help these people who know Flash already, and want to take a good look at Silverlight and improve their skills in .NET.

That said, the book also guides the reader into more advance topics, and we go quite far and broad. Where I didn’t have the space to talk in detail about very advanced techniques, I at least gave indications to the reader where he can find more information. A book cannot cover all, but once you bring the reader to a certain point, I considered it my duty as an author to help the reader to continue learning on his own. I think I was rather successful in that way.

DZone - Do you have any future books in the works?
Laurent - The editor and I are talking about future books, but I must admit that I am still unsure. Starting at a new job with many responsibilities, many travels and wanting to keep my family happy are very important things for me. I loved every moment of the writing process (ok, maybe not EVERY moment), but it is a lot of work and I want to consider it carefully before I start again. For those interested to know more about this and other aspects of my work, they can follow me on my blog at http://blog.galasoft.ch and on Twitter (@LBugnion). I am always happy to meet readers and hear what they have to say!



The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}