Create rich interfaces with Microsoft Silverlight

Microsoft's Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications for the Web. Find out why Tony Patton is impressed with the Silverlight development model.

Web developers often frown on the use of technologies like Macromedia Flash or Adobe Shockwave to spice up Web interfaces. Since these technologies are not Web standards, they may not properly work in all browsers. Even so, some developers continue to use these technologies. Recognizing an area of technology without a presence, Microsoft has thrown its considerable weight behind an initiative to make inroads in the area now dominated by Flash with its Silverlight product.

What is Silverlight?

Microsoft describes Silverlight as a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications for the Web. The plug-in is for rendering the applications in your browser. The plug-in is available for the Mac OS (version 10.4.8) and Windows 2000/XP/Vista and Server 2003. The following browsers are supported: Internet Explorer 6 and 7, Firefox 1.5 and 2.0, and Safari.

Silverlight-based applications are developed with eXtensible Application Markup Language (XAML) and JavaScript, and it integrates with existing Web technologies without problems. The UI is defined using XAML with JavaScript handling events. This promotes the concept of separating presentation from development.

The technology

While JavaScript is an established technology, XAML (pronounced "Zammel") is relatively new. XAML is the XML-based markup language that works with the new graphic subsystem delivered with Windows Vista and .NET Framework 3.0. You can define graphical assets, user interfaces, behaviors, animations, and more using XAML.

Silverlight is closely tied to the .NET Framework, but it is self-contained; that is, it does not require Windows or the .NET Framework -- everything is available in the plug-in to handle Silverlight pages. In fact, the XAML used within Silverlight is a subset of the XAML in Windows Vista and the .NET Framework.

Silverlight's XAML focuses on the Web development aspects of the language and leaves out the desktop elements. Silverlight includes a mini Common Language Runtime (CLR) from .NET. This means that a subset of the full .NET platform that runs on desktops can be accessed from within the browser.

Silverlight development

Given the fact that XAML is an XML-based language, you can easily develop XAML (including JavaScript) with your favorite text editor. Visual Studio 2005 supports XAML development as well. In addition, a Silverlight template is available for building Silverlight pages or applications within Visual Studio 2005. The template is part of the Silverlight Software Development Kit.

Once you install the development kit, the template is available within Visual Studio 2005. You select Silverlight JavaScript application as the template when creating a new Visual Studio 2005 project. The XAML is developed, and then a Web form is developed to use the XAML and includes any necessary code. At this point, a Web page is developed that includes the Silverlight control that uses the XAML.

In addition to the XAML support in Silverlight, Microsoft's suite of Expression tools, particularly Microsoft Expression Design and Microsoft Expression Blend, allow designers to assemble graphical artifacts and UIs with XAML as the end result. Also, there is a tool available to convert existing Flash animations to the XAML format. You can learn more about Silverlight development at the Silverlight Developer Center.

My impressions

I have never been a big advocate of Flash or Shockwave when building Web interfaces. One problem with a technology like Flash is learning a whole new development environment, as well as a language with ActionScript. One positive aspect of Silverlight is its usage of existing Microsoft technologies and a tool like Visual Studio 2005 -- technologies and tools that I use every day.

The ability to develop code along with XAML and JavaScript makes Silverlight stand out from other products. For example, a Flash application may need to communicate with a back end Web service to get data, but Silverlight can include the code to handle server communications and data loading.

Silverlight requires a browser plug-in just like competing technologies, so the paradigm hasn't shifted that much. The plug-in requirement raises issues with Web standards and a Web application properly loading in all browsers.

All in all, I am impressed with the Silverlight development model; it allows you to use an XML language and JavaScript to build interfaces, and everything is available through .NET code.

It will be interesting to see if Microsoft can make inroads on the well-established customer bases of both Adobe and Macromedia. Also, it remains to be seen whether user interface developers will embrace the product.

What do you think of Silverlight?

If you have examined Silverlight, what are your thoughts? Do you like including Flash or Shockwave based content in your Web applications? Share your experience with the Web development community.

Check out the Web Development Zone archive, and catch up on the most recent editions of Tony Patton's column.

Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.


Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Development Zone newsletter, delivered each Tuesday. Automatically subscribe today!

By Tony Patton

Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a productio...