Silverlight vs Flash

The most successful browser plug-in is Adobe Flash, which is installed on over 90 percent of the world’s web browsers. Flash has a long history that spans more than ten years, beginning as a straightforward tool for adding animated graphics and gradually evolving into a platform for developing interactive content.

It’s perfectly reasonable for .NET developers to create web sites that use Flash content. However, doing so requires a separate design tool and a completely different programming language (ActionScript) and programming environment (Flex). Furthermore, there’s no straightforward way to integrate Flash content with server-side .NET code. For example, creating Flash applications that call .NET components is awkward at best. Using server-side .NET code to render Flash content (for example, a custom ASP.NET control that spits out a Flash content region) is far more difficult.

Silverlight aims to give .NET developers a better option for creating rich web content. Silverlight provides a browser plug-in with many similar features to Flash, but one that’s designed from the ground up for .NET. Silverlight natively supports the C# language and embraces a range of .NET concepts. As a result, developers can write client-side code for Silverlight in the same language they use for server-side code (such as C# and VB) and use many of the same abstractions (including streams, controls, collections, generics, and LINQ).

The Silverlight plug-in has an impressive list of features, some of which are shared in common with Flash, and a few of which are entirely new and even revolutionary. Here are some highlights:

Widespread browser support: It’s too early to tell how well the Silverlight browser works on different platforms. Currently, the beta builds of Silverlight 2.0 work on Windows Vista and Windows XP (in the PC universe) and OS X 10.4.8 or later (in the Mac world). The minimum browser versions that Silverlight 2.0 supports are Internet Explorer 6, Firefox 1.5.0.8, and Safari 2.0.4. Although Silverlight 2.0 doesn’t currently work on Linux, the Mono team is creating an open source Linux implementation of Silverlight 1.0 and Silverlight 2.0. This project is known as Moonlight, and it’s being developed with key support from Microsoft. To learn more, visit http://www.monoproject.com/Moonlight.

Lightweight download: In order to encourage adoption, Silverlight is installed with a small-size setup (about 4MB) that’s easy to download. That allows it to provide an all-important “frictionless” setup experience, much like Flash (but quite different from Java).

2D drawing: Silverlight provides a rich model for 2D drawing. Best of all, the content you draw is defined as shapes and paths, so you can manipulate this content on the client side. You can even respond to events (like a mouse click on a portion of a graphic), which makes it easy to add interactivity to anything you draw.

Controls: Developers don’t want to reinvent the wheel, so Silverlight is stocked with a few essentials, including buttons, text boxes, lists, and a grid. Best of all, these basic building blocks can be restyled with custom visuals if you want all of the functionality but none of the stock look.

Animation: Silverlight has a time-based animation model that lets you define what should happen and how long it should take. The Silverlight plug-in handles the sticky details, like interpolating intermediary values and calculating the frame rate.

Media: Silverlight provides playback of Windows Media Audio (WMA), Windows Media Video (WMV7 through WMV9), MP3 audio, and VC-1 (which supports high definition). You aren’t tied to the Windows Media Player ActiveX control or browser plug-in—instead, you can create any front end you want, and you can even show video in full-screen mode. Microsoft also provides a free companion hosting service (at http://silverlight.live.com ) that gives you space to store media files. Currently, it offers a generous 10GB.

The CLR: Most impressively, Silverlight includes a scaled-down version of the CLR, complete with an essential set of core classes, a garbage collector, a just-in-time (JIT) compiler, support for generics, threading, and so on. In many cases, developers can take code written for the full .NET CLR and use it in a Silverlight application with only moderate changes.

Networking: Silverlight applications can call old-style ASP.NET web services (ASMX) or Windows Communication Foundation (WCF) web services. They can also send manually created XML requests over HTTP. This gives developers a great way to combine rich client-side code with secure server-side routines.

Data binding: Although it’s not as capable as in its big brother, Windows Presentation Foundation (WPF), Silverlight data binding provides a convenient way to display large amounts of data with minimal code. You can pull your data from XML or in-memory objects, giving you the ability to call a web service, receive a collection of objects, and display their data in a web page—often with just a couple of lines of code.

Of course, it’s just as important to note what Silverlight doesn’t include. Silverlight is a new technology that’s evolving rapidly, and it’s full of stumbling blocks for developers who are used to relying on .NET’s rich libraries of prebuilt functionality. Prominent gaps include lack of database support (there’s no ADO.NET), no support for 3D drawing, no printing, no command model, and few rich controls like trees and menus (although many developers and component companies are building their own). All of these features are available in Windows-centric WPF applications, and they may someday migrate to the Silverlight universe—or not.


Source of Information : Apress Silverlight 2 Visual Essentials

0 comments


Subscribe to Developer Techno ?
Enter your email address:

Delivered by FeedBurner