views:

3867

answers:

4

I'm just introducing myself to the basic differences between Silverlight 3 and it's predecessor. Looking at Domain Service Class within RIA services, the execution seems quite a bit simplified. Can someone explain the basic differences between this and Windows Communication Foundation?

Does the Domain Service Class employ WCF or some other services framework in the background, or is this new from the ground up?

+9  A: 

I recommend you read this blog article which mentions that:

Our thinking on the RIA Services work really grow out of the LINQ project a few years ago. LINQ integrates query semantics into the languages (C#, VB, etc) providing a common abstraction for working with data; whether that data is in memory CLR objects, XML, relational data, or anything else. With RIA Services we are extending this pattern by offering a prescriptive model for exposing your domain logic over LINQ. We think of domain logic as that part of your application that is very specific to your domain – that is the particular business problem you are solving.

So it is to 'domain logic' what LINQ is to data, whereas WCF is essentially just a service provider.

In traditional N-Tier development this means that:

...you should think of RIA services as a more perceptive layer on top of ADO.NET Data Services and WCF... We also expect to eventually provide full access to all the power and flexibility from the underlying WCF services such as highly optimized binary serialization.

Or you also have the option to use the new "RIA Services pattern" to:

...build ASP.NET applications easily while taking advantage of all the built in features of RIA Services such as data validation, authorization, etc. In the March preview, we are offering a asp:DomainDataSource control that enables very easy ASP.NET WebForms access to your domain logic. Building on top of that is a future version of ASP.NET Dynamic Data that makes it very easy to generate common, standard UI based on your domain logic.

This essential means that the RIA Services can either:

  • Sit on top of WCF (essentially wrapping the WCF services for the Client App to consume).
  • Replace the WCF layer with RIA Services using alternatice data source (eg. ADO.NET Entity Data Model/Entity Framework as per Building A Data-Driven Expense App with Silverlight 3)

It is also worth checking out Mix09: Building Amazing Business Applications with Silverlight 3 for another example.

As i'm writing this i've just discovered Microsoft's .NET RIA Services Overview which looks like it explains a lot of the rational behind RIA Services (and probably a bit clearer than some of the above :)

mundeep
Great answer! At the moment I'm pretty sure RIA Services always sits on top of WCF (the Building a Data-Driven Expense App w SL3 article doesn't state otherwise). Could you update your post with a specific example that shows RIA services not utilizing WCF?
James Cadd
I didn't read the data-driven article in detail but didn't see any use of WCF in it (just passing mention?).Also if you look at page 114 of the Microsoft Overview pdf the "Using the ASP.NET DomainDataSource" example that essentially just uses RIA + Linq 2 Sql
mundeep
Linq 2 Sql is a server side technology - I think that part of the article is discussing ASP.NET, not Silverlight.
James Cadd
From the little bit I've seen, it seems that by adding the "Domain Service Class" to a project, you get "web service" like interface to the server side project from your silverlight app... but I don't see any of the WCF hooks in the web.config.The synchronous "feel" of the the access to these services is particularly interesting as well.
Traples
+1  A: 

We use a combination of both. WCF for bulky data that works better with binary serialization and RIA for CRUD entities because the code is so much faster to write and maintain. If RIA supported binary we would use it instead of WCF, but I am pretty sure it does not in the current release version.

A: 

but Deploy RIA to IIS not Show Data ...Error DataService

Jacky Kenhjiro
A: 

WCF has much more options to debug as in RIA. The domain datasource is easier to set up but more difficult to figure out mistakes. In much cases WCF will use for making an interoperability communication system which desolute older WSDL with WSSE header security.

Timo