Articles‎ > ‎Technical Articles‎ > ‎

Silverlight Architecture

posted Aug 11, 2009, 11:13 AM by Thiyagaraaj M   [ updated Aug 16, 2009, 9:47 PM ]

Introduction:

This topic describes the essential architecture and components of Microsoft Silverlight. Silverlight is not only an appealing canvas for displaying rich and interactive Web and media content to end users. It is also a powerful yet lightweight platform for developing portable, cross-platform, networked applications that integrate data and services from many sources. Furthermore, Silverlight enables you to build user interfaces that will significantly enhance the typical end user experience compared with traditional Web applications.

While Silverlight as a client-side runtime environment seems simple and compact in size, the Silverlight development platform integrates a number of features and complex technologies, making them accessible for developers. To create effective Silverlight-based applications, developers need a working knowledge of the platform architecture.

Note:

There are currently two versions of Silverlight, Silverlight 1.0 and Silverlight 2. Many of the features in this article, including .NET Framework support, are supported only in Silverlight 2, which is a beta product. For specific information about the architecture of Silverlight 1.0, see Silverlight 1.0 Architecture Overview. For a comparative feature list, see Silverlight Overview (Silverlight.net).

This topic acquaints you with the following basics of the Silverlight architecture:

  • The Silverlight platform as a whole.

  • The core presentation framework components.

  • The .NET Framework for Silverlight components.

  • Additional Silverlight programming features.

  • Information about features provided in the two versions of Silverlight.

  • Related technologies and tools.

The Silverlight Platform

The Silverlight platform as a whole consists of two major parts, plus an installer and update component:

Component

Description

The core presentation framework

Components and services oriented towards the UI and user interaction, including user input, lightweight UI controls for use in Web applications, media playback, digital rights management, data binding, and presentation features, including vector graphics, text, animation, and images. Also includes the Extensible Application Markup Language (XAML) for specifying layouts.

The .NET Framework for Silverlight

A subset of the .NET Framework that contains components and libraries, including data integration, extensible Windows controls, networking, base class libraries, and the common language runtime (CLR).

Some parts of the .NET Framework for Silverlight are deployed with your application. These "Silverlight Libraries" are assemblies not included in the Silverlight runtime and are instead shipped in the Silverlight SDK. When Silverlight Libraries are used in your application, they are packaged up with your application and downloaded to the browser. These include new UI controls, XLINQ, Syndication (RSS/Atom), XML serialization and the Dynamic Language Runtime.

The installer and updater

An installation and update control that simplifies the process of installing the application for first-time users, and subsequently provides low-impact, automatic updates.

  • The following illustration shows these components of the Silverlight architecture, along with related components and services.

Silverlight architecture


There is a particular value in the combined set of tools, technologies, and services included in the Silverlight platform: They make it easier for developers to create rich, interactive, and networked applications. Although it is certainly possible to build such applications using today's Web tools and technologies, developers are hindered by many technical difficulties, including incompatible platforms, disparate file formats and protocols, and various Web browsers that render pages and handle scripts differently. A rich Web application that runs perfectly on one system and browser may work very differently on another system or browser, or may fail altogether. Using today's large array of tools, protocols, and technologies, it is a massive and often cost-prohibitive effort to build an application that can simultaneously provide the following advantages:

  • Ability to create the same user experience across browsers and platforms, so that the application looks and performs the same everywhere.

  • Integration of data and services from multiple networked locations into one application using familiar .NET Framework classes and functionality.

  • A media-rich, compelling, and accessible user interface (UI).

  • Silverlight makes it easier for developers to build such applications, because it overcomes many of the incompatibilities of current technologies, and provides within one platform the tools to create rich, cross-platform, and integrated applications.

Core Presentation Components

The core presentation features of the Silverlight platform, shown in the previous section and illustration, are listed in the following table with descriptions:

Feature

Description

Input

Handles inputs from hardware devices such as the keyboard and mouse, drawing, or other input devices.

UI rendering

Renders vector and bitmap graphics, animations, and text.

Media

Features playback and management of various types of audio and video files, such as .WMP and .MP3 files.

Controls

Supports extensible controls that are customizable through styling and templating.

Layout

Enables dynamic positioning of UI elements.

Data Binding

Enables linking of data objects and UI elements.

DRM

Enables digital rights management of media assets.

XAML

Provides a parser for XAML markup.

Developers can interact with this presentation framework by using XAML to specify presentation details. XAML is the primary point of interaction between the .NET Framework and the presentation layer. Developers can programmatically manipulate the presentation layer using managed code.

The .NET Framework for Silverlight

The following table describes a partial list of the .NET Framework for Silverlight features shown in the previous illustration.

Feature

Description

Data

Supports Language-Integrated Query (LINQ) and LINQ to XML features, which ease the process of integrating and working with data from disparate sources. Also supports the use of XML and serialization classes for handling data.

Base class library

A set of .NET Framework libraries that provide essential programming functions, such as string handling, regular expressions, input and output, reflection, collections, and globalization.

Window Communication Foundation (WCF)

Provides features to simplify access to remote services and data. This includes a browser object, HTTP request and response object, support for cross-domain HTTP requests, support for RSS/Atom syndication feeds, and support for JSON, POX and SOAP services.

CLR (common language runtime)

Provides memory management, garbage collection, type safety checking, and exception handling.

WPF (Windows Presentation Foundation) Controls

Provides a rich set of controls that ship as a Silverlight Library to deploy with your application. This includes Button, Calendar, CheckBox, DataGrid, DatePicker, HyperlinkButton, ListBox, RadioButton, and ScrollViewer.

DLR (dynamic language runtime)

Supports the dynamic compilation and execution of scripting languages such as JavaScript and IronPython to program Silverlight-based applications. Includes a pluggable model for adding support for other languages for use with Silverlight.

The .NET Framework for Silverlight is a subset of the full .NET Framework. It provides the essentials of robust, object-oriented application development for application types (such as Internet applications) for which this support has not traditionally been available.

Developers can interact with the .NET Framework for Silverlight layer by writing managed code using languages they already know, including C# and Visual Basic. .NET Framework developers can also access the presentation layer by authoring in Visual Studio 2008 or Microsoft Expression Blend.

Note:

.NET Framework support is provided only in Silverlight version 2.

Additional Silverlight Programming Features

Silverlight provides several additional features that help developers create rich and interactive applications, including those described in the following table.

Feature

Description

Isolated storage

Provides safe access from the Silverlight client to the local machine's file system. Enables local storage and caching of data isolated to a particular user.

Asynchronous programming

A background worker thread carries out programming tasks while the application is freed up for user interaction.

File management

Provides a safe File Open dialog box, to ease the process of creating safe file uploads.

HTML - managed code interaction

Enables .NET Framework programmers to directly manipulate UI elements in the HTML DOM of a Web page. Web developers can also use JavaScript to call directly into managed code and access scriptable objects, properties, events, and methods.

Serialization

Provides support for serialization of CLR types to JSON and XML.

Packaging

Provides the Application class and build tools to create .xap packages. The .xap package contains the application and entry point for the Silverlight plug-in control to run.

XML libraries

XMLReader and XMLWriter classes simplify working with XML data from Web services.The XLinq feature enables developers to query XML data directly within .NET Framework programming languages.

Articles