Overview of WCF RIA Services in Silverlight 4

Silverlight can take advantage of WCF RIA Services and its features to help build business applications. WCF RIA Services makes n-tier development as simple as traditional two-tier development by including enterprise-class networking and data access for building n-tier applications with transactional support and data paging.  WCF RIA Services allows you to expose an object model on the server through an optimized .NET to .NET binary format as well as a set of open extensions to the ATOM formatted known as OData and an open JavaScript Object Notation (JSON) format to Silverlight application. It offers support for including metadata on the object model to describe validation requirements such as required fields and checking for valid ranges.  It also supports custom validation for a single property or across an entire class. In addition, WCF RIA Services has features to assist with change tracking on the client in Silverlight, user authentication, and personalization.  All of these features and others help WCF RIA Services make it easier to build business applications with Silverlight.

Microsoft WCF RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms using the power of WCF for communication. WCF RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. It also provides end-to-end support for common tasks such as data validation, authentication and authorization based on roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier.


Key Classes: DomainService and DomainContext

WCF RIA Services provides framework and tooling support for some of the common RIA patterns. A RIA developer authors a DomainService to define the application logic on the mid-tier that operates on a set of data classes called entities. RIA Services then generates the corresponding client-side entity proxies and DomainContext class on Silverlight. The generated classes allow a developer to retrieve data, work with it with rich binding and change tracking capabilities and submit a unit of work corresponding to application tasks completed by the end user of the application. The two parts of the application are weaved together in a single Visual Studio solution to simplify iterative development and testing. In addition, a set of common tasks such as validation, authentication and authorization are pre-plumbed and simplified through declarative attributes.

untitled.JPG

WCF RIA Services in an Architecture

Entities act as containers or data and associated validation information specified as attributes or external metadata. They are obtained via Data Access Layer (DAL) of your choice. Examples includeEntity Framework, LINQ to SQL, web services, DataReader, or DataSet.