08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

356<br />

CHAPTER 15 ■ ENHANCING THE WEB EXPERIENCE WITH SILVERLIGHT<br />

of <strong>Silverlight</strong> 2.0 are available (they are called 1.1 in the downloads, but Microsoft plans<br />

to update them to a 2.0 early beta in spring 2008), <strong>and</strong> these enhance the programming<br />

model with a new, mini version of the .<strong>NET</strong> CLR, allowing applications to be built <strong>and</strong><br />

coded using C# or other .<strong>NET</strong> languages. <strong>Silverlight</strong> 2.0 also includes these enhancements:<br />

• The ability to run programs written with multiple programming languages has<br />

been added. In addition to JavaScript, the new mini CLR allows C# <strong>and</strong> Visual Basic<br />

to be used in building applications.<br />

• The inclusion of a high-performance runtime has been included. Having your<br />

application logic compiled into .<strong>NET</strong> code can lead to drastic improvements in<br />

performance. For example, Microsoft has built a sample chess algorithm that does<br />

a look-ahead for chess moves, constrained to 1 second. You can play this game on<br />

www.silverlight.net. You will be able to see that the performance of the C# version<br />

(measured in the number of moves it can evaluate in 1 second) is generally 1,000 to<br />

1,500 times faster than the JavaScript version. While this isn’t a conclusive benchmark,<br />

it is certainly indicative of the improvements in performance.<br />

• Extensibility to XAML has been added in version 1.1. Now you can create your own<br />

XAML controls to improve the overall experience.<br />

• New XAML UI controls for application development have been added.<br />

• Networking via the System.<strong>NET</strong> libraries has been added. Thus, <strong>Silverlight</strong> applications<br />

will be able to directly consume network resources in the services tier of a<br />

multitier application.<br />

• Data enhancements such as LINQ are available.<br />

• Cross-platform debugging is available, so an application running on Mac OS X will<br />

be debuggable from Visual Studio running on a Windows PC.<br />

While these features are very compelling, at the time of writing this book, they are in<br />

a very early stage, <strong>and</strong> this book will focus only on <strong>Silverlight</strong> 1.0.<br />

The Anatomy of a <strong>Silverlight</strong> Application<br />

As <strong>Silverlight</strong> is a browser plug-in, using it could be as simple as using an tag in<br />

HTML that refers to the plug-in, <strong>and</strong> defining a set of tags to configure it.<br />

So, you could easily add a <strong>Silverlight</strong> plug-in to your page like this:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!