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:
- http://www.silverlightdata.com/Simple/HibProducts.svc/Products
- http://www.silverlightdata.com/Simple/HibProducts.svc/Products(1)
- http://www.silverlightdata.com/Simple/HibProducts.svc/Products(1)/Category
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
Nice!
hm.. isn't this similar to what the EF team think is so great about EF/EDM ?
Yes, and one of the reasons that I am not seeing much reason for excitement there.
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/NHibernate_LINQ_with_ADO_NET_Data_Services
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.
No, Linq for NH will be released (hopefully) with NH 2.1, not 2.0
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.
It happens in Linq to NHibernate, discussion of that is in the nh contrib mailing list
Comment preview