Chapter 1. Getting Started with Silverlight 2

You’ve learned how Silverlight can produce stylish interfaces and highly interactive applications in a variety of browsers, and now you want to build a Silverlight application. Not just a bouncing ball, an embedded video, or a spiffy-looking series of buttons, but a walking, talking, fully functional line-of-business application. Of course, you still want the snazzy interface, too. The good news is that you can have it all with Silverlight 2.

In this chapter, I will review some of the critical areas that you need to be familiar with to develop data-driven Silverlight applications, including required software installations and tools. Before developing with Silverlight 2, it is important to understand the major differences between versions 1 and 2 of Silverlight. This chapter will review those differences and point out why each advancement in Silverlight 2 is important to developing data-driven applications.

One important advancement that Silverlight 2 introduces is the ability to write .NET code. This allows developers to leverage their existing skills to create robust Silverlight 2 applications. The .NET 3.5 language features in Silverlight 2, such as LINQ and implicitly typed variables, can also significantly aid in the development of these applications. This chapter will discuss some of these .NET 3.5 language enhancements as they are used throughout this book. I will also walk through the steps of creating a simple data-driven Silverlight 2 application to help get you started.

The Importance of Data Access

Beyond the rich user interfaces, video streaming, and stylish templates in Silverlight 2 lies a robust framework that works very well with various types of data sources. Silverlight applications run in the client machine’s browser, where they have the Internet between them and any server applications. Silverlight applications are disconnected from remote data sources, so they must communicate with remote servers through various types of web services to send and receive data.

Silverlight 2 provides several ways to get data from remote servers using HTTP and sockets. Some of the most popular and useful techniques are to communicate with a SOAP-based web service on a remote server (as we’ll explore in Chapters 5 and 6), and to receive data from a REST service (which we’ll discuss in Chapters 7–9). Several tools and techniques are available for receiving the data, manipulating it, binding it, presenting it to the user, and handling all of the data-driven aspects of the application, all inside Silverlight 2.

Most applications require some sort of data interaction. The data might be from a database, an RSS feed, a web service, or a REST service that returns Plain Old XML (POX). Silverlight applications can communicate with services and return data in a variety of ways. Although Silverlight can be a very rich and compelling tool for end users, the data for the application is just as important as its delivery.

Data access has taken on several meanings in recent years. Data access really is a term that describes the act of accessing data from any number of sources. This can mean accessing data from a database directly through ADO.NET, the ADO.NET Entity Framework, NHibernate, LLBLGen Pro, Enterprise Library, or some custom business object and data access layer. It can also mean accessing data through web services, ASMX, Windows Communication Foundation (WCF), RSS feeds, REST-style web services, and HTTP requests. Obviously, you can access data in several ways, and once you’ve retrieved it, you often need to manipulate it in some way. Developers often use LINQ to organize data that has been retrieved so that it can be in a more usable shape for the task at hand. All of these aspects define data access, and you can use all of these directly or indirectly through Silverlight 2.

Get Data-Driven Services with Silverlight 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.