Wednesday, November 12, 2008

Microsoft Silverlight - A View

Silver light is a new cross-browser, cross-platform implementation of the .NET framework for building and delivering the next generation of media experiences and Rich Interactive Application(RIA) for the web.
Till date, there have been two ‘major’ Silverlight releases by Microsoft: Silverlight 1.0, and Silverlight 2.0.
Silverlight 1.0 – Silverlight 1.0 applications are a mixture of XAML (Extensible Application Markup Language), HTML, and JavaScript. When a Silverlight 1.0 application is run in the browser, it invokes the Silverlight control, which in turn loads up the XAML file.
Silverlight 2.0 – Silverlight 2.0 is a superset of Silverlight 1.0 . The major difference between the two lies in the fact that Silverlight 2.0 includes a refactored version of the .NET framework with CLR 3.0. This change brings along a flexible programming model and has been designed from ground up to support .NET languages like C# and VB.NET, which in turn lets you utilize your .NET skills. Silverlight 2 also supports Dynamic Language Runtime (DLR) for compilation and execution of dynamic languages like IronPython, Managed JScript and IronRuby.
Silverlight 2 comes with a subset of the WPF programming model and includes support for user interface controls, layout, databinding, documents, media, and animation. Silverlight can also deliver high-quality video to all major browsers running on the Mac OS or Windows.
Silverlight 2 is just a 4.6 MB download but the benefits are huge. The download contains a stripped down version of the .NET framework in your browser. So there is no need to install the .NET framework on client machines.
Getting Silverlight :Install Silverlight Tools for Visual Studio 2008 SP1 This add-on for Visual Studio 2008 SP1 or Visual Web Developer Express with SP1 will install the necessary Visual Studio updates, Silverlight project templates, developer runtime, and SDK. For additional information read the overview and the Silverlight 2 Readme Notes.
Install Microsoft Expression Blend 2 and then install Microsoft Expression Blend 2 Service Pack 1Expression Blend 2 along with Service Pack 1 allows designers to graphically create UI’s for Silverlight 2 applications.
Install Deep Zoom Composer This tool allows you to prepare your images for use with the Deep Zoom feature in Silverlight 2.
Download Silverlight Toolkit This Toolkit is a Microsoft project containing Silverlight controls, components and utilities that can be downloaded and used in your Silverlight applications. It includes full source code, samples and tests.
Advantages:
Animation
The Flash format itself has no notion of animation other than transformation matrices. You can apply a matrix to an element on a per frame basis to move it around. Want to move something across the screen in 3 seconds? Calculate how many frames 3 seconds will take, then calculate the matrix required for each frame along the way. Oh, and don’t forget that the player won’t actually maintain any frame rate unless you embed blank audio tracks, so that 3 seconds might turn out to be 2 or 6 or 5, it just depends what kind of mood the machine is in.
Silverlight supports the WPF animation model, which is not only time based instead of frame based, but lets you define the start and end conditions and it will figure out how to get there for you. No need to deal with matrixes. No need to calculate positions on various frames. It just works.
Shapes
Flash stores its shapes using binary shape records. In order to write shape definitions, you will need to either license a 3rd party Flash file format SDK, or build your own. It isn’t too difficult, but it does require a bit of a learning curve and the ability to manipulate things at the bit level, since shape records don’t align on byte boundaries. Needless to say, it isn’t the kind of thing most people can write and have all debugged in one afternoon.
Silverlight uses XAML. XAML is text based and can be output using a simple XML object. No need to buy special libraries to write files. No need to write your own libraries. Just stream some text to a file and you’re done--easily the type of thing that can be debugged and finished in an afternoon.
Text
Flash stores its font’s glyphs using the same exact shape definitions that are used for any other shape. The player itself does not understand TTF files, so you’ll end up digging deep into the Win32 APIs and the fairly vague definitions in the Flash file format documentation to come up with something that sort of does the trick. You’ll probably spend ages trying to deal with all the intricacies of fonts, because it turns out that typography is actually fairly complex… and you will have to deal with all those complexities yourself.
WPF/E lets you embed true type font information directly into your projects, and download that information with the downloader object. No need to do anything special. No need to handle anything yourself. It just works.
Video / Audio
Flash supports multiple video formats. The latest codec is really high quality and the bandwidth usage is nice. There is one problem though if you are creating a tool that outputs Flash content… the formats it supports aren’t really used by anyone else. The original video codec, Sorenson’s proprietary H.263 implementation is a mutant version of H.263. The compression follows the spec fairly closely, but there are a bunch of features dropped out and you can’t exactly just go find a complete spec on how to build your own encoder. The later codec from On2 puts you in an even worse position. Licensing Sorenson’s codec isn’t that expensive, but On2 will rape you with fees. They are relying on revenue from licensing the codec used by Flash to revive their $2 a share stock price. It is also a completely proprietary format (where at least the Sorenson one was loosely based on a standard). The audio formats Flash supports are all proprietary, except for ADPCM, which no one uses because of its horrible compression, and MP3, which is decent but dated, and still requires licensing fees and 3rd party conversion libraries.
Compare that to the Silverlight story. Silverlight implements industry standard VC-1 codec for video, as well as offering support for WMV and WMA. Just about everyone already has Windows Movie Maker, but if they don’t it’s not a big deal. Why? Because Microsoft makes available a free Encoder SDK for producing WMA and WMV. So, not only are you using formats that people are more likely to be able to encode themselves, but Microsoft also provides your product with SDKs if you want to do the encoding yourself. The best part about it is that Microsoft doesn’t rely on WMA/WMV licensing revenue to keep themselves alive, so not only is it easier to integrate, but it’s also cheaper.
Scripting
You can reuse C# classes from your tool inside your exported content. There is no development environment out there for creating real desktop applications which is based on ActionScript. If you go the Flash route, this means that all your classes and objects have to be written twice. You need .NET classes to handle the author time experience and Flash classes to handle the run-time. If you have server components, once again you need to switch back to .NET and throw out all the classes that the run time is using. For example, let’s say you are creating a tool that outputs rich media quizzes. With Silverlight / .NET, the same entity classes you use to deal with results in the player could be reused on the server side. With Flash, you’d have to write all that logic 2x and keep it in sync as your tool changes.
Tools
You can create Silverlight content with the same tools you use on a daily basis. Visual Studio.NET is by far the most powerful and most popular IDE. You can potentially have all the code for the server components, the authoring tool components, and the runtime/player components inside the same project. No extra skills required. No needing to hire some special Flash guru to do the graphics junk. Every developer can contribute to every part of your application.
Conclusion :
Here I would like to conclude this article with some of the amazine features which include:
* Support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer
* Improved server scalability and expanded advertiser support
* Advanced content protection
* Deep zoom, for zooming and navigation of ultrahigh resolution imagery
* Advanced skinning and template support etc....
So that Microsoft Silverlight comes birghtly.... To learn get good future in IT.