views:

3698

answers:

4

Hi there,

Could someone compare and contrast on WCF Rest services vs. ADO.NET Data Services? What is the difference and when to use which?

Thanks,

Ray.

Edit: thanks to the first answer, just to give a bit background on what I'm looking to do: I have a web app I plan to put in the cloud (someday), the DAL is built with ADO.NET Entity Framework. And, I need to figure which web service data access technology would best fit my case.

+6  A: 

Not sure I can give a complete answer here but I spent a lot of time at PDC trying to figure this out myself so here’s a go...

The short answer here is that ADO.Net Data Services are meant to provide an interface to the ADO.Net framework (DataContext, Datasets, DataTables etc…) that is seamlessly integrated with the web, using URIs and well-known data to point to your Data. ADO.Net Data Services are also meant for programming ADO.Net in the cloud. Microsoft's Cloud services, "Azure", is a new cloud programming platform that will be release in the near future. For more info on Cloud Services go here.

One cool thing I found out about ADO.Net Data Services and the cloud is that the underlying DataContext that acts as the provider to your data source can be easily configured to point your resource in the cloud, or, an on premise database. This allows you to switch your DataContext without changing any code!!! (I was impressed by that if you couldn't tell)

WCF Rest Services are just normal WCF Services that have added functionality so that they can be consumed in a RESTful manner (URI vs URL, Usage of HTTTP Verbs, Usage of Different Data Transfer Formats like JSON, YAML, etc...). So for example, if you had a stock ticker web service that you built in WCF, instead of requiring the caller to use a heavy WSDL implementation and ASMX, you could just use the WCF Rest functionality to publish that service as a JSON service instead and have it consumed via AJAX without having to point to an ASMX resource. For more info on WCF using rest check out the PDC Presentation

matt_dev
See my post next, originally posted as a comment, then I think it needs to be longer than 300 chars
ray247
+1  A: 

Thank you so much for the insight! For my app, I do plan to put it in the cloud and I also used ADO.NET Entity Framework to build my DAL, so it sounds like ADO.NET Data Services is the one for me to choose.

One cool thing I found out about ADO.Net Data Services and the cloud is that the underlying DataContext that acts as the provider to your data source can be easily configured to point your resource in the cloud, OR, an on premise database. This allows you to switch your DataContext without changing any code!!! (I was impressed by that if you couldn't tell)

Could you maybe say more on this point regarding how ADO.NET Data Service + EF would work in the cloud?

ray247
A: 

WCF Data Services (previously known as ADO.NET Data Services), http://msdn.microsoft.com/en-us/data/aa937697.aspx

gperc
A: 

If you want to develop and deliver a data centric service, in certain cases a lot of functionalities can be achieved by both the WCF rest starter kit and WCF data service, as both of these technologies of WCF can deliver your data in a RESTful way (e.g. with addressable content with URLs and standard formats of data such as xml and json). They also both equip with an array of .NET classes for dealing and handling a lot of network and web requests such as HTTP interceptors and cache.

However, one advantage that WCF data service owns but not the REST starter kit is that WCF data service can expose its data in the form of .NET entity objects and in standard formats(this is achieved by the OData protocal). So I guess WCF data service would give you more versatile performance in a lot of real world scenarios.

cutyMiffy