What is Silverlight?
- The history of Silverlight
- Silverlight architecture
- The environments in which Silverlight can be hosted and executed
This lesson will present you with a high-level overview of Microsoft Silverlight.
An Overview of Silverlight
Silverlight enables development of the next generation of Microsoft .NET-based media experiences and rich interactive applications (RIAs) for the Web. Silverlight is delivered as a cross-platform and cross-browser plug-in that exposes a programming framework and features that are a subset of the .NET Framework. Two versions of Silverlight are available, version 1.0 and version 2.0.
Version History
Version 1.0 was released to market in September 2007. Silverlight version 1.0 includes the ability to:
- Create and manage 2D graphics and animation
- Handle mouse, keyboard, and ink input
- Deliver WMV, WMA, and MP3 media
- Work with JPEG and PNG imaging
- Format and manipulate text
- Communicate with services and download server resources by using the HTTP downloader
- Parse Extensible Application Markup Language (XAML) content and markup
- Navigate Web content by utilizing the JavaScript Document Object Model (DOM)
Version 2.0 is planned for release to market in the summer of 2008. Silverlight version 2.0 will include:
- All of the functionality included in Silverlight version 1.0
- Support for managed code C#, VB, Python, Ruby)
- XAML extensibility
- Control class and sample controls
Support
The industry has been abuzz about Silverlight since the beginning of 2007 when Microsoft began demonstrating the power of Silverlight at developer conferences. In fact, no other development technology has been so highly anticipated since the arrival of the .NET Framework and Silverlight resources and examples abound on the Web. To spark developer interest in Silverlight, Microsoft has launched several community Web sites dedicated to Silverlight development including the Silverlight home page and the Silverlight.net community Web site as shown in the figures below:
The Microsoft Silverlight home page:
The Silverlight.net home page
Early Adopters
In response to the overwhelming developer community anticipation for the arrival of Silverlight, many developers and companies have become early adopters of the technology. Companies including the World Series of Poker, the Discovery Channel, the Emmys, Home Shopping Network (HSN), World Wrestling Entertainment (WWE), Major League Baseball (MLB), Fox, XBOX 360, and
Netflix have all developed stunning applications by using Silverlight. Many of the published early adopter applications are featured in the Silverlight.net showcase as seen in the figure below:
The Silverlight.net showcase page.
A Bit of History
Up to the late 1990s, Microsoft offered three primary development environments and a single Web development platform. The three primary development environments included C++, Visual Basic, and Visual FoxPro. Each of the development environments was completely isolated from the other development environments thus making communication between applications created with each of the development environment very difficult.
Microsoft technologies leading up to Silverlight
Microsoft Visual C++
Microsoft Visual C++ is used to write very low level code that generally is more compact, utilizes less memory, and, thus, performs better. However, due to C++ being a lower level language, it is also a more complex and time consuming language to program in. Writing efficient and optimized code using C++ is considered a science. C++ gives the developer much more precise control over exactly how much memory and resources are being used but without in depth knowledge of memory registers and resources, a developer can easily write code using C++ that performs very poorly. Most platform-level applications created by Microsoft are written using C++ (Windows, SQL Server, etc).
Microsoft Visual Basic
Visual Basic, version 6.0 and versions prior to Visual Basic .NET, was initially created by Microsoft to simplify writing code. Visual Basic automates many memory-related and low level programming tasks that C++ requires a developer to master. Due to Visual Basic assisting the developer in quickly creating applications, it is considered a "toy language" by most "hard core" C++ programmers. A constant rivalry has always existed between the C++ and Visual Basic developers. However, many more developers use Visual Basic than C++ because you can normally create applications using Visual Basic in less time that are stable and exhibit acceptable performance.
Microsoft Visual FoxPro
Visual FoxPro is considered the fastest professional database development environment in the industry. FoxPro utilizes dBase (.dbf) data files as well as accessing external databases and performs lightening fast data access by using a proprietary technology named Rushmore Technology that is based on data indexes. Microsoft acquired FoxPro so that it could integrate Rushmore technology into SQL Server. Visual FoxPro has a large following of developers worldwide, is much easier to use than C++, offers excellent performance, but was not considered as popular with developers of C++ and Visual Basic.
Microsoft Active Server Pages (ASP)
The Web development platform offered by Microsoft is called Active Server Pages (ASP). ASP code is interpreted instead of compiled and is programmed using either VBScript or JavaScript. Prior to .NET, ASP was very popular but had many limitations and faced competition in Web applications that were created by using the Java development environment. Java offers the ability to create an application that end users can execute by downloading the Java Virtual Machine (JVM). The JVM is available for most computing platforms and, hence, most Java applications can be executed on most platforms.
In the late 1990s, Microsoft determined that Web applications and Web-enabled applications would constitute a majority of future software applications created. Microsoft needed to present a new approach to creating applications that would surpass Java and all other competitors.
The .NET Framework
Microsoft introduced the .NET Framework in 2000 as its new approach to software development. The .NET Framework borrowed ideas from the best practices in the software industry as well as brought new ideas to the table in an effort to meet developer needs and requests.
Virtually all programming languages manage data at some point. The primary reason that communication between applications created using C++, Visual Basic, Visual Foxpro, and other languages was difficult was because each language stored data being managed in a unique set of data types. Hence, an integer in one language may not represent an integer in another language and, in order to communicate between languages, data being managed by each language needed to be converted to common data types.
The .NET Framework introduced a common set of data types (the Common Type System) that is utilized by all .NET-compliant languages C++, Visual Basic, C#, etc). Thus all languages can easily intercommunicate. Furthermore, all .NET-compliant languages render a common result when compiling code, Microsoft Intermediate Language (MSIL). The .NET Framework is similar to Java in this respect. MSIL can be deployed to any platform running the Common Language Runtime (CLR). Currently, the CLR is only available for Microsoft Windows although an open source version of the CLR was created for Linux (called Mono). Code written by using the .NET Framework is compiled instead of interpreted thus resulting in much better performance than Java and competing technologies.
Microsoft took the Web development industry by storm with their .NET upgrade to ASP. ASP .NET is, arguably, the most popular development facet of the .NET Framework. ASP .NET put a new face on Web development through a compiled code architecture and improved state management and it provides access to the full functionality of the .NET Framework. ASP .NET was built around XML, supports the latest Web development standards, and supports creation of advanced Web Services.
The .NET Framework also provides extremely improved data access and database integration through the new ADO .NET.
There are many more features and benefits of the .NET Framework than those mentioned here. The .NET Framework has become the leading software development environment available.
Introducing Silverlight
As of the writing of this course, the .NET Framework has been released in version 3.5 and includes features that encompass all facets of Windows, Web, and network development. The .NET Framework 3.5 includes classes, methods, and properties numbering just under 10,000 and complies with the latest Web development standards and has introduced revolutionary technologies used in Windows Vista development, rich media and user experiences, workflow management, security and authorization, and complete distributed communication protocols. The .NET Framework can also be fully extended by developers to create custom classes and types. The functionality of the .NET Framework spans the server, the local workstation, and across the Web. The four primary additions to the .NET Framework as of version 3.0 are Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and CardSpace.
WPF is used to develop elaborate user interfaces like those that adorn Windows Vista and managed advanced media streaming and integration. WCF encompasses the ASP .NET Web Services and .NET remoting functionality that was contained in the .NET Framework 2.0 as well as new communication technologies. WF is used to model complex workflow processes and CardSpace is the embodiment of new security and user authorization functionality.
A frontier that the .NET Framework had not fully extended to is the Web user's browser space (browser). ASP .NET AJAX was developed to improve performance in the browser space by making postbacks and calls between the Web client and server asynchronously and has been a great success. ASP .NET AJAX utilizes JavaScript and new types and controls developed specifically for use with ASP .NET AJAX.
Although ASP .NET and ASP .NET AJAX offer impressive capabilities in the browser, both are heavily dependent upon the ASP .NET page event life cycle, are tightly coupled to the server, and have a tough time competing with advanced, media-rich plugin solutions such as Adobe Flash. Additionally, it is incredibly difficult to create Web applications that offer a consistent experience across all supported browsers and platforms by using ASP .NET and AJAX. In 2006, Microsoft began developing a solution to extend into the browser and offer media experiences more robust than competing plugin solutions.
In order to further extend the .NET Framework and associated functionality into the browser and do so in an extremely competitive manner, Microsoft introduced Silverlight (originally referred to as WPF/E). Silverlight is a free plugin that the user downloads and it encompasses a subset version of the .NET Framework and WPF. In a manner similar to the JVM, Silverlight functions in the browser within the boundaries of the "sandbox". The sandbox is a secure zone installed into the browser that accommodates Silverlight functionality while completely protecting the host platform from any possibly adverse actions performed by Silverlight.
Silverlight Architecture
While ASP .NET and Silverlight both utilize the .NET Framework and are both used for Web development, Microsoft Silverlight functions in a different manner than ASP .NET. As opposed to ASP .NET, the bulk of Silverlight processing occurs on the client machine thus decreasing server resource utilization and improving the Web experience on the client. The figure below illustrates a comparison between ASP .NET processing and Silverlight processing:
When a client initially attempts to run a Silverlight application, if the Silverlight plug-in has not been installed on the client machine, it will be downloaded and installed. Upon subsequent requests to run the application, the application will instantiate on the client machine and make requests for resources from the server only when necessary. The Silverlight plug-in can be thought of as a scaled-down version of the full .NET Framework. The Silverlight plug-in does not contain all classes and functionality contained in the full .NET Framework but only those classes and functionality that are applicable to a Silverlight Web client. Furthermore, the classes and functionality included in the Silverlight plug-in were streamlined and optimized for use on the Web client machine.
Silverlight was designed using the same design paradigm as ASP .NET. Each page of a Silverlight application includes an associated code behind file that includes the code that handles events fired by the page. Silverlight resembles WPF in that it uses Extensible Application Markup Language (XAML) to construct the user interface (presentation layer). With that said, Silverlight applications are composed of text-based files that include XAML and code. Silverlight applications can be created using any text editor, however more advanced tools and development environments, such as Visual Studio or Expression Suite, simplify the task significantly.
Silverlight Versions
As of the writing of this course, Silverlight is available in 2 versions. Version 1.0 has been released to market and version 2.0 is scheduled to be released to market in the early part of 2008.
Version 1.0 includes support for creating rich interactive applications (RIA) and utilizes JavaScript as its programming language. Version 1.0 supports the industry-leading Windows Media Services enabling delivery of audio and video that includes 2D and vector graphics.
Version 2.0 includes all features of version 1.0, support for the .NET Framework, support for .NET-compliant programming languages such as C#, Visual Basic, Python, and Ruby, and support for database operations and language-integrated query (LINQ). Version 2.0 was originally named version 1.1, however, due to the large number of changes and additions, was later renamed to version 2.0.
The figure below identifies some of the differences between version 1.0 and version 2.0 (identified here as version 1.1):
The diagram located at Images/SilverlightTechnologyMap.gif gives a broad picture of the technologies to be supported by Silverlight version 2.0.
Silverlight Hosting
Microsoft Silverlight functionality is completely encapsulated within the Silverlight plug-in. Web applications typically require the server hosting the Web application to meet minimum requirements. Silverlight applications simply require a Web server in the same manner as HTML documents. Silverlight applications can be hosted on any Web server accessible to your target audience. The two most commonly used Web servers are Microsoft Internet Information Server (IIS) and Apache.
Executing a Silverlight application on a Web client machine is a two step process. First, the application will detect if the Silverlight plug-in is installed on the Web client machine. If the plug-in is not installed, a request will be made of the Web server to download and install the plug-in. The Silverlight plug-in is embodied in a .dll executable file that is loaded into the Web client browser memory once installed. The only interaction required by the Web client when installing the Silverlight plug-in is to grant permission for the plug-in to be installed. Various Web servers, including Microsoft Internet Information Server (IIS), may require slight configuration modifications so that the Silverlight executable file will be downloaded to the Web client when requested instead of being automatically loaded into the memory of the Web server.
Second, if the Silverlight plug-in is installed on the Web client machine, the Silverlight application itself must be downloaded. A Silverlight application may consist of many types of files. Slight configuration modifications may be necessary on the Web server so that XAML files are associated with Silverlight and downloaded correctly to the Web client machine when requested.
Once the Silverlight plug-in is installed on a Web client machine and a Silverlight application is downloaded, the Silverlight application is then hosted on the Web client machine. There are some requirements necessary for the Web client machine as discussed in the sections below, however all media players, audio and video codecs, compilers and the runtime are encapsulated in the Silverlight plug-in.
Supported Platforms
Whilst requirements for a server that will serve Silverlight content are minimal, there are requirements for the Web user client machine. The Silverlight plug-in must be able to install and function correctly on the Web user client machine. Silverlight currently supports the platforms discussed below.
Microsoft Windows
Silverlight supports the following versions of Microsoft Windows:
- Microsoft Windows Vista
- Microsoft Windows XP
- Microsoft Windows 2000
- Microsoft Windows Server 2003
Macintosh
Silverlight supports the following versions of the Mac operating system:
- Mac OS 10.4.8+ (Power PC)
- Mac OS 10.4.8+ (Intel-based)
Linux
Many developers are unaware that a version of the .NET Framework exists for the Linux operating system. Linux is an open source operating system that is supported heavily in the online community. The version of the .NET Framework that supports Linux is named the Mono project and was also developed by the open source community. The developers of the Mono project keep the project close to in sync with the .NET Framework when updates are released by Microsoft and created a version of Silverlight that supports Linux in approximately 21 days!
Supported Browsers
Silverlight applications run within the confines of a plug-in. There are many benefits to using a plug-in with the primary benefit being consistency across implementations. A plug-in application generally delivers a very consistent result in every instance where it is supported. Other plug-in solutions, such as Adobe Flash, were incredibly popular due to consistency across implementations. For instance, a plug-in application should deliver a consistent result regardless of whether it is displayed using Internet Explorer or Safari.
Consistency in all implementations is an inherent problem with all standard Web applications due to the design of the Web and browsers. Standard Web applications are created and rendered using a text-based, declarative markup language called Hypertext Markup Language (HTML). A Web browser is an application that reads an HTML file, interprets it, and displays the result to the Web user. The developer of each browser is at their leisure to determine how their browser will interpret and render HTML markup commands. Thus, a standard, HTML-based Web application may appear and behave very differently in one browser versus another browser and this is beyond the control of the Web application developer. Furthermore, there are many versions of HTML as well as many browsers.
The solution to inconsistent Web application results across browser implementations is to create a separate version of the Web application for each browser supported. When a request is made for the Web application, the request contains minimal information about the request, including the type and version of the browser that will be displaying the requested Web application. Maintaining multiple versions of an application is significantly more time consuming in terms of development time and testing time. Creating and maintaining a separate version of an application for each browser supported has been very difficult for Web developers and caused many developers to resent particular browsers.
An alternative solution is to create a Web application that utilizes the most basic HTML commands. The very simple HTML commands are generally supported consistently across all browsers. However, this approach severely limits the capabilities of the Web application. ASP .NET attempted to minimize inconsistency between browsers by automatically generating the HTML supported by a particular browser to display the Web application. However, some minor inconsistencies are still noticeable when using different browsers to display an ASP .NET application.
A plug-in, however, is a small, compiled application that is simply supported by and hosted by each browser. The process used to read, interpret, and render a plug-in-based application is completely controlled by the plug-in developer instead of the browser developer. Hence, all browsers that are capable of hosting the Silverlight plug-in will display a Silverlight application in the exact same manner and render the exact same results.
Internet Explorer
Internet Explorer is Microsoft's Web browser. Silverlight was first supported by Internet Explorer. Silverlight is supported by Internet Explorer version 7 on Windows Vista, Windows XP, and Windows Server 2003 and by version 6 on Windows XP, Windows Server 2003, and Windows 2000 (using Silverlight version 2.0). The figure below illustrates a simple Silverlight application displayed in Internet Explorer version 7 on Windows Vista:
Mozilla Firefox
Silverlight is supported by Mozilla Firefox version 2 and version 1.5 on Windows Vista, Windows XP, Windows 2000 (using Silverlight version 2.0), Windows Server 2003, Mac OS 10.4.8+ for the PowerPC (using Silverlight version 1.0), and Mac OS 10.4.8+ for Intel-based PCs. The figure below illustrates a simple Silverlight application displayed in Mozilla Firefox version 2.0.0.7 on Windows Vista. Mozilla Firefox is also the default Web browser used by most Linux users and Silverlight applications are supported using Firefox on Linux in its Moonlight rendition:
Safari
Silverlight is supported by Apple Safari on Mac OS 10.4.8+ for the PowerPC (using Silverlight version 1.0), and Mac OS 10.4.8+ for Intel-based PCs. Safari is available for Windows and is on the roadmap for Silverlight support but, as of the writing of this course, Safari for Windows does not support Silverlight. If you attempt to run a Silverlight application using Safari for Windows, even with Silverlight installed, you'll see an installation prompt similar to the figure below:
Opera
Silverlight is not yet supported by Opera. Opera is available for Windows and is on the roadmap for Silverlight support but, as of the writing of this course, Opera does not support Silverlight. If you attempt to run a Silverlight application using Opera for Windows, even with Silverlight installed, you'll see an installation prompt similar to the figure below:
Netscape
Curiously, Microsoft does not advertise that Netscape supports Silverlight or that it has any plans to support the Netscape browser. However, when attempting to run the simple Silverlight application on Windows Vista using Netscape 9.0, the application performs just fine. The more advanced features of Silverlight have not yet been tested using Netscape but will be tested later in the course. The figure below illustrates a simple Silverlight application displayed in Netscape version 9.0 on Windows Vista:
Target Design Platforms
The Silverlight plug-in renders graphics and multimedia using a vector-based graphics engine. Vector graphics can easily be scaled from very small displays to very large displays of varying resolutions with virtually no loss of image quality. The current release of Silverlight targets standard Web client workstations however Microsoft is working on a prototype of the Silverlight plug-in for use on Windows Mobile devices. Silverlight on a Windows Mobile device will accommodate delivering live, streaming, high quality video to smart phones and similar devices. The goal is to enable developers to deliver rich interactive applications (RIA) to any type of device.
What is Silverlight? Conclusion
In this lesson of the Silverlight tutorial, you
- Explored Microsoft Silverlight at a high level
- Studied some of the history leading up to the release of Silverlight
- Investigated the architecture and versions of Silverlight
- Analyzed the Silverlight hosting environment, Web client workstation platform, and supported browsers
