views:

2235

answers:

3

I'm currently in the process of creating a Silverlight 3 data driven application. To access the database, 2 common approaches are used: RIA Services and ADO.NET Data Services. Does anyone have any guidance on when/why to choose each approach? Here is what I've gathered from my research / experience. Any thoughts?

ADO.NET seems to be only useful for strictly database calls. If you need to expose the data services to other applications (ignoring Silverlight 3's domain restriction), this is a good approach. Also, if the URL/Query syntax can be useful in your application, this is another advantage

RIA Services seem to be a more flexible, accepted framework. It seems to give you more than strictly database access. It does have a limitation of only being used for the Silverlight / Web application as it is not exposed via a service.

Thoughts? Ideas? Comments?

+10  A: 

Over the wire, ADO.NET data services and RIA services are very similar (they are both REST based).

However, with ADO.NET data services and all other REST services you get no easy to see API within Visual Studio. Ex: you dont know what calls to the database are available and the returned data is not strongly typed. It makes for a very interoperable data system but it can be a pain to work with.

With RIA services, you get the best of both worlds since your RIA project is referenced directly for silverlight projects so Visual Studio can know what methods are available and everything is strongly typed. All other apps can use this service (dataservice.axd) but they dont have the luxury of an API.

EDIT: Correction: ADO.NET Data Services does generate metadata (Sorry for bad info) http://msdn.microsoft.com/en-us/library/cc716656.aspx

vidalsasoon
Good information. I'll have to give you a "virtual" vote since I'm too new to Stack Overflow (reputation only 11) to vote your answer up.
Cody C
I believe you are wrong about: "no easy to see API within Visual Studio" regarding Data Services. ADO.NET Data Services can be imported into Visual Studio just like any WCF/RIA solution which allows you in code to view the API via the strongly typed methods/classes which are created.
Robert MacLean
Overall good thread, but I agree with Robert - ADO.NET Data Services is very easy to look under the hood of.
Soulhuntre
A: 

I did a prototype of a system with Silverlight 2 and ADO.NET Data services and I am currently going forward with an MVVM implementation using Silverlight 3 and RIA services for an LOB application.

RIA has a security model that saves you from creating your own with WCF for Silverlight use. It is based on the ASP.NET security provider model. It has an interesting and powerful validation model that allows you to easily insert your own customer validators.

The main issues with RIA Services are that they are very new, not in final form, and have very little documentation with more than a simplist case senario. Beta is expected at PDC in November and the RTM with EF 4.0, C# 4.0 and VS2010.

When working with something this early, you can expect substantial refactoring with changes as releases are made, and some frustration with small changes that are not as easy to spot.

We are currently working around bugs in EF and RIA and we may need to use Data services to do some things until RIA is more stable.

There is strong typing with both Data Services and RIA. Intellisense works with both. Resharper does not yet support RIA, although it is expected in their 5.0 release.

Mark Kovalcson
A: 

This is very old question but would like to add a answer for readers.

Ria services is layer on top of ADO.net data services. Ria services use ADO.Net as base framework and adds layer for easy usage for UI library.

So question can be when use RIA Services and when use ADO.Net data services

mamu