Microsoft Silverlight
From Wikipedia, the free encyclopedia
Mac OS X Symbian OS
Microsoft Silverlight is a web browser plugin for client side programmable vector graphics in Internet Explorer. Because of IE's dominant role in browsers, the absence of such capabilities was holding the field back; Silverlight modernizes Internet Explorer to a level similar to the other browsers which already supported JavaScript programmable vector graphics - such as Safari's Canvas and SVG in Firefox and Opera. Due to the similarities between Silverlight, Safari's Canvas and the W3C's SVG, frameworks like Dojo can substitute one for the other based on browser - as long as JavaScript is used.
Microsoft has positioned Silverlight as a source of new business for their proprietary programming paradigms. For use in Internet Explorer, Silverlight has similar functionality to and competes with Adobe Flash, Adobe Flex, Adobe Shockwave, and JavaFX.
Contents
[edit] Overview
Silverlight provides a retained mode graphics system, similar to WPF and integrates multimedia, graphics, animations and interactivity into a single runtime environment. It is being designed to work in concert with XAML and is scriptable with JavaScript. XAML can be used for marking up the vector graphics and animations. Textual content created with Silverlight would be more searchable and indexable than that created with Flash as it is not compiled, but represented as text (XAML).[1] (This, however, will become less true as more search engines (currently only Google) adopt the new Adobe flash player for search engines.[2]) Silverlight can also be used to create Windows Sidebar gadgets for Windows Vista.[3]
Silverlight supports playback of WMV, WMA and MP3 media content[4] across all supported browsers without requiring Windows Media Player, the Windows Media Player ActiveX control or Windows Media browser plugins. Because Windows Media Video 9 is an implementation of the SMPTE VC-1 standard, Silverlight also supports VC-1 video, though still only in an ASF file format. Furthermore, the Software license agreement says VC-1 is only licensed for the "personal and non-commercial use of a consumer".[5] Silverlight does not support playback of H.264 video. Silverlight makes it possible to dynamically load XML content that can be manipulated through a DOM interface, a technique that is consistent with conventional Ajax techniques. Silverlight exposes a Downloader object which can be used to download content, like scripts, media assets or other data, as may be required by the application.[6] With version 2.0, the programming logic can be written in any .NET language, including some common dynamic programming languages like Ruby and Python.[7]
Silverlight was developed under the codename Windows Presentation Foundation/Everywhere (WPF/E). It is compatible with multiple web browser products used on Microsoft Windows and Mac OS X operating systems. Mobile devices, starting with Windows Mobile 6 and Symbian (Series 60) phones, will also be supported.[8] A third-party free software implementation named Moonlight is under development to bring compatible functionality to GNU/Linux.
[edit] Releases
[edit] Silverlight 1.0
Silverlight 1.0 consists of the core presentation framework, which is responsible for UI, interactivity and user input, basic UI controls, graphics and animation, media playback, DRM support, and DOM integration.[9] It is made up of the following components:
A Silverlight application starts by invoking the Silverlight control from the HTML page, which then loads up a XAML file. The XAML file contains a Canvas object, which acts as placeholder for other elements. Silverlight provides various geometrical primitives like lines, ellipses and other shapes, to elements like text, images, and media etc. The elements are properly positioned to achieve the desired layout. Any arbitrary shape can be created as well. These elements can be animated using Event triggers; some animation effects are predefined, others can be created as composite of the pre-defined effects. Events like keyboard or mouse movements can also raise Events which can be handled by custom scripts.[10]
Programmatic manipulation of the UI is achieved by using scripting languages to modify the Document Object Model of the Silverlight Canvas object.[9] To facilitate this, Silverlight exposes a DOM API, accessible from any scripting language supported by Silverlight, which in version 1.0 release is limited only to JavaScript running in the browser. However, there are no UI widgets built in. The native widgets of the browser must be overlaid on top of the Silverlight Canvas for user input. Support for data formats is limited to XML and JSON only.[9]
[edit] Silverlight 2
Version 2.0, now in beta-testing, brings improved interactivity and support for .NET languages and development tools.
Silverlight 2 (previously referred to as version 1.1)[11] includes a version of the .NET Framework, implementing the same full Common Language Runtime version as .NET Framework 3.0; so it can execute programs written in any .NET language. Unlike the CLR included with .NET Framework, multiple instances of the CoreCLR included in Silverlight can be hosted in one process.[12] With this, the XAML layout markup file (.xaml file) can be augmented by code-behind code, written in any .NET language, which contains the programming logic. It can be used to programmatically manipulate both the Silverlight application and the HTML page which hosts the Silverlight control. The XAML markup as well as the code, is compiled into .NET assemblies which are then compressed using ZIP and stored in a .xap file.[13]
Silverlight ships with a lightweight class library which features, among others, extensible controls, XML Web Services, networking components and LINQ APIs. This class library is a subset of and is considerably smaller than .NET Framework's Base Class Library. Silverlight code runs in a sandbox which prevents invoking platform APIs.[14] Silverlight 2 also adds support for adaptive streaming of media files (which allows Silverlight to choose the bit rate of the media based on available bandwidth) as well as Windows Media DRM[15] and PlayReady[16]DRM in media files.[9]
The version of .NET Framework in Silverlight adds[9] a subset of WPF UI programming model, including support for shapes, documents, media and animation objects of WPF. Beta 2 onwards,[16] it ships with more than 30 UI controls[15] (including TextBox, CheckBox, Slider, ScrollViewer, and Calendar controls, among others),[17] supporting two-way databinding support, automated layout management (by means of StackPanel, Grid etc)[17] as well as data manipulation controls such as DataGrid[18][11] and ListBox.[17] UI controls are skinnable using a template-based approach.[17] Third party libraries for expanded sets of UI controls are also available.[19]
The included Base Class Library (BCL) provides classes for collections, reflection, regular expressions, string handling and data access. It also supports LINQ, with the full support for LINQ to Objects and expression trees. Almost all of the System.LINQ and System.LINQ.Expression namespaces are exposed. It also supports serialization of objects, for data persistence. Silverlight can handle data in RSS or JSON format, in addition to XML. The BCL provides enhanced support for working with XML data, including the XMLReader and XMLWriter classes. Silverlight 2 also supports asynchronous programming via the use of the threading libraries.[18]
Silverlight also includes classes for data access over XML-based Web services, REST, WCF Services and ADO.NET Data Services.[16] The networking support in Silverlight can be used by Silverlight applications to communicate using HTTP, or at the lower socket level. Cross-domain communication is supported. [15] Silverlight uses an XML-based configuration file to control the cross-domain resource access policy, both for HTTP connections as well as socket connections. It can be used by site administrators to control which resources a Silverlight application that did not originate in the domain of the site can access. In addition, Silverlight also supports the Adobe Flash cross domain policy file format.[20] Silverlight sockets can only initiate a connection; they cannot listen for connections.[21]
Silverlight 2 includes[16] the Dynamic Language Runtime (DLR) which allows dynamic compilation and execution of dynamic (scripting) languages. Compilers for the languages based on the DLR (including IronPython and IronRuby) are be packaged with the DSL app in the .xap package.[22] The DSL SDK includes a web server named Chiron that can dynamically package all the dependencies for the DSL application and serve it to the browser.[22] The first upcoming languages written for the DLR are Managed JScript, IronPython 2.0, and IronRuby. Microsoft also plans to build Visual Basic .NET 10.0 (VBx) on the DLR. All four languages share the same infrastructure to allow Silverlight to compile and execute the language source. Conversely, other .NET languages must be compiled ahead of time and delivered to Silverlight as .NET assemblies. The implementation of Managed JScript conforms to the ECMAScript 3.0 specification, and Microsoft claims that it is 250 times faster than interpreted JScript.[18]
With the integration of .NET Framework, Silverlight also allows HTML-managed code interaction, which allows manipulation of HTML DOM elements from managed code,[9] as well as allow JavaScript code to call managed code and use objects instantiated by managed code. Silverlight encloses JavaScript objects and DOM elements in managed wrappers to make them available from managed code.[23] However, in the 1.1 alpha release directly calling JavaScript code is not implemented, but managed code events can fire JavaScript handlers. A Silverlight instance does not need to have a UI component in order to manipulate the HTML DOM from managed code.[24] It is done by creating a XAML Canvas with its width and height set to zero, and using its code-behind code to modify the Document Object Model of the HTML page via the APIs in the System.Browser namespace.[25]
Silverlight 2 includes Deep Zoom, a technology derived from Microsoft Live Labs Photosynth. It allows users to zoom into or out of an image (or a collage of images), with smooth transitions, using the mouse wheel.[26] The images can scale from 2 or 3 megapixels in resolution to gigapixel range, but the user need not wait for it to be downloaded entirely; rather Silverlight downloads only the parts in view, optimized for the zoom level being viewed.[27] Beta 2 onwards, Deep Zoom uses an XML-based file format.[16]
Silverlight 2 also allows limited filesystem access to Silverlight applications.[23] It can use the operating system's native Open file dialog box to browse to any file (which the user has access to). The file is sanitized of path information to prevent the application from getting access to information like user name and can be opened only in read-only mode. For local storage of data, Silverlight provides isolated local storage (isostorage),[23] which is stored, outside the browser cache, in a hidden folder inside the user profile's private folder. It is by default set to 1 MB per URL,[23] but can be changed by the user.[16] Data stored by a Silverlight application in the isostorage is identified by the URL that it loads from, can be accessed by that application only. All instances of Silverlight share the same isostorage, so all instances of the same Silverlight application can share the saved data, even if they are running on different browsers.
Silverlight CoreCLR uses an attribute based security model, as opposed to the Code Access Security (CAS) model of the desktop version of .NET Framework.[28] All assemblies are marked with a security attribute, which can be either transparent (SecurityTransparentAttribute), safecritical (SecuritySafeCriticalAttribute) or critical (SecurityCriticalAttribute). Methods in transparent assemblies runs with partial trust, and any code in such assemblies cannot call critical methods. They also cannot contain unverifiable code (use the unsafe C# keyword or use pointers) or invoke system functions by means of P/Invoke. Code in both critical and safecritical assemblies run with full trust, and are not subject to such limitations. However, critical methods can only be called from safecritical methods and not transparent methods. Thus transparent methods are prevented from using methods that can cause system wide changes. Instead, they have to call safecritical methods which will verify that the call is safe and within the limited rights of the caller, and then proxy it to the critical methods. In fact, the IsoStorage APIs are exposed as safecritical methods.[28] An assembly that does not have any attribute set is run as a transparent method. The limitations also apply for type inheritance, virtual method calls and interface method calls as well.[29] Silverlight assemblies can contain members that are not usable by CoreCLR but can be by .NET Framework CLR; such methods will not be loaded when the assembly is being executed by CoreCLR.[30]
However, only platform code is allowed to be marked as Critical or SafeCritical. The Silverlight runtime ensures that platform assemblies are loaded only from the Silverlight installation directory, and are digitally signed by Microsoft. This effectively means that all user application assemblies can only be transparent code and run under partial trust and limited rights.[31] Platform code can be marked with either attribute. The BCL methods of the .NET Framework, which have the Internet attribute set allowing them to be called from untrusted code originating from Internet, are exposed in Silverlight BCL as transparent methods.[31]
[edit] Release history
[edit] Compatibility
The following table presents an availability and compatibility matrix of Silverlight versions for various operating systems and web browsers.
[edit] Development tools
Silverlight applications can be written in any .NET programming language. As such, any development tools which can be used with .NET languages can work with Silverlight, provided they can target the Silverlight CoreCLR for hosting the application, instead of the .NET Framework CLR. Microsoft has positioned Microsoft Expression Blend versions 2.0 and 2.5 for designing the UI of Silverlight 1.0 and 2 applications respectively. Visual Studio 2008 can be used to develop and debug Silverlight applications. To create Silverlight projects and let the compiler target CoreCLR, Visual Studio 2008 requires the Silverlight Tools for Visual Studio which is available as a beta release.[44]
A Silverlight project contains the Silverlight.js and CreateSilverlight.js files which initializes the Silverlight plugin for use in HTML pages, a XAML file for the UI, and code-behind files for the application code. Silverlight applications are debugged in a manner similar to ASP.NET applications. Visual Studio's CLR Remote Cross Platform Debugging feature can be used to debug Silverlight applications running on a different platform as well.[45]
[edit] Licensing
An unattributed report claimed[46] that Microsoft aims to release certain parts of Silverlight source code as open source software, but Sam Ramji, director of platform technology strategy at Microsoft, said the company has no plans to do so.[47] However, the Dynamic Language Runtime, included with Silverlight, have been made available on Microsoft's CodePlex website using the Microsoft Public License. The collection of controls included in Silverlight 2 will also be made available under the same license.[48]
[edit] Alternative implementations
The Mono team is currently developing Moonlight, a free and open-source implementation of both the Silverlight 1.0 and 2.0 runtimes[49].
The project is officially supported by Microsoft who,[39] under an agreement with Novell, has made additional specifications, access to the Silverlight Base Class Library APIs, binary codecs and test cases available to the Mono team,[40] none of which are available to other members of the public.[50]
The 'covenant' under which Novell has been granted this exclusive access also specifies conditions that are incompatible with the licencing that covers most other free and open source software. As examples, it specifically requires that the software must have been "obtained directly from Novell or through an Intermediate Recipient" and that it must be "not licensed under GPLv3 or a Similar License".[41] Free sofware proponents Groklaw have called the covenant "radioactive" and "worthless",[51] although Novell, Inc. is enthusiastic.[52]
Silverlight has been criticized for keeping Linux out of their official offering. Even with Microsoft's official support of the Moonlight project, Bruce Chizen, former CEO of Adobe, and maker of direct competitor Flash, has questioned "the commitment of Microsoft to keep the Silverlight platform compatible with other OS than Windows".[53] His concerns are based on "examples from history" where Microsoft has launched products with promises of ongoing cross-platform compatibility that no longer apply, such as Internet Explorer for UNIX, the Microsoft Java Virtual Machine, OS/2, and Windows Media Player.
[edit] Relationship to existing Web standards
The international, non-profit European Committee for Interoperable Systems has voiced concerns that with Silverlight Microsoft aims to introduce content on the web that can only be accessed from the Windows platform. They argue that use of XAML in Silverlight is positioned to replace the cross-platform HTML standard. Effectively, if Silverlight usage becomes widespread enough, users will risk having to purchase Microsoft products to access web content.[54]
California and several other U.S. states also have asked a District Judge to extend most of Microsoft's antitrust case settlement for another five years,[55] citing "a number of concerns, including the fear that Microsoft could use the next version of Windows to 'tilt the playing field' toward Silverlight, its new Adobe Flash competitor," says a Seattle Post-Intelligencer article.
Microsoft has also been criticized for not using the Scalable Vector Graphics standard for Silverlight, which, according to Ryan Paul of Ars Technica, is consistent with Microsoft's ignoring of open standards in other products, as well.[56] However, according to David Betz, an independent .NET technologies specialist, Microsoft would have needed to alter the SVG specification to add .NET integration and UI constructs on top of SVG to make it suitable for scenarios Silverlight uses markup for (UI and vector markup, by default). Consequently, he thinks the "choice by Microsoft to use XAML over SVG, served to retain the SVG standard by not adding proprietary technology [to extend SVG]".[57]
