Ayende @ Rahien

Unnatural acts on source code

ADO.Net Data Services with NHibernate

Shawn Wildermuth has bridged the gap between the two, implementing IUpdatable on top of Linq to NHibernate. This means that you can now expose your NHibernate domain model as a set of REST services.

This functionality is now included with Linq for NHibernate. Thanks Shawn!

There is a live sample here: http://www.silverlightdata.com/Simple/NHibernate.aspx

Or you can hit the URLs directly and see what kind of formatting it has:

From a technological perspective, I think this is awesome. However, there are architectural issues with exposing your model in such a fashion. Specifically, with regards to availability and scalability on the operations side, and schema versioning and adaptability on the development side.

ADO.Net Data Services are a very thin wrapper around a DB, and as such, they should be treated as such. Do not expose them where you wouldn't want to expose your DB as well.

Comments

Torkel
07/21/2008 05:21 PM by
Torkel

Nice!

hm.. isn't this similar to what the EF team think is so great about EF/EDM ?

Ayende Rahien
07/21/2008 05:26 PM by
Ayende Rahien

Yes, and one of the reasons that I am not seeing much reason for excitement there.

Shawn Wildermuth
07/22/2008 06:57 AM by
Shawn Wildermuth

The EF/EDM and ADO.NET Data Services are not really related or speak to the same problem. See the bottom of my blog post about caveats in using NHibernate and ADO.NET Data Services here for some of my perspective:

http://wildermuth.com/2008/07/21/NHibernateLINQwithADONETDataServices

Justin DeCourcy
07/30/2008 01:27 PM by
Justin DeCourcy

Are ther plans to move NHibernate.Linq the current release version of NHibernate 2.0 (CR1 I think now)? I know there are some major differences between the trunk and 2.0 branch that breaK NHibernate.Linq - are there plans to apply those changes to the release branch? We're using other parts of the NHibernate ecosystem that use the release branch, but I'd like to use Linq & ADO,Net Data Services, too. If there's anything I can do to help let me know.

Ayende Rahien
07/30/2008 01:30 PM by
Ayende Rahien

No, Linq for NH will be released (hopefully) with NH 2.1, not 2.0

fars1d3r
08/20/2008 02:26 PM by
fars1d3r

I have been working with the Linq an ADO.Net Data service and have found the translation of the rest query to the Linq syntax needs some work - Can you guide me as to where this translation takes place and I will have a crack at it.

Ayende Rahien
08/20/2008 02:42 PM by
Ayende Rahien

It happens in Linq to NHibernate, discussion of that is in the nh contrib mailing list

Comments have been closed on this topic.