Wednesday, July 04, 2007

I've been very interested in the progress of the entity framework. Recently, the June ctp was announced.

It boasts some new feature I had been waiting for, like the ability to detach the object from a context. This is necessary when you want to work in a disconnected manner. It would be fantastic if we would be able to retrieve a graph (spanning is now supported) and send it to a client, having the client change it and then reattach it to a new object context on the server. This would mean having to do change tracking on the client yourself, which does leave for more flexibility in your serialization format, as compared to using strange change tracking iEnumerable implementations that are out of your control.
This is the path Microsoft is taking. There is no real persistence ignorance yet, but they might be heading for a comfortable compromise.

Which brings me to nHibernate. The project I'm heading is a pretty big client-server application, which we are migrating to-wards a more flexible n-tier. We are rebuilding the client-side with WPF (for other reasons) and are implementing WF in the back-end to manage our processes. We have build our own naive OR-mapping layer on top of the datasets that were already in place. This has allowed me to delay having to make a choice for a real OR-mapper.
I have had some great experience with nHibernate, having used it since the 0.7 beta. Lately I have not had the opportunity to use it, but it seems the 1.2 release has added some major missing pieces of functionality like SPROC support and generics. I have some time left before I will have to choose between entity framework and nHibernate but I can already see it's going to be tough:

The generated code is ugly and although they have listened to the persistence ignorance argument, it seems too little, too late. Their V1.0 implementation might be an attempt to do it correctly, but if they had just listened earlier, their approach would have been much cleaner.
nHibernate is based on a proven concept and is very clean (although the code-base wasn't clean when I stepped through it ;-) ). It has a great community uptake. It, however, still lacks good modeling tools and it only has one dedicated programmer.

In the end, if Entity Framework turns out workable, it might be the better choice. It will get a big community (although a large part of that community will consist of programmers that don't even know of the alternatives), it has a big team of smart people working on it (although they needed quite a few tries to get it right) and it will have great visual tools (love it). In the end, most importantly, when I hire new people for the project, they are more likely to know EF then nHibernate. Is that a good reason though????

Saturday, July 07, 2007 7:58:42 PM (Romance Standard Time, UTC+01:00)
There are several commercial model tools for NHibernate, and ActiveWriter is free and can generate NHibernate files.
I would also like to protested about the "one dedicated programmer", that is misleading in an OSS project. There are quite a few people who actively contribute.
Friday, July 13, 2007 9:46:12 PM (Romance Standard Time, UTC+01:00)
I've been using CSLA.NET, worth a look, but the other solutions mentioned may be more mature nowadays.
Saturday, July 21, 2007 3:13:50 PM (Romance Standard Time, UTC+01:00)
Ayende: Although you are right, there are active contributors, I was merely illustrating the vast amount of developers Microsoft has at it's disposal. Also, do not read into this post that I am in favor of Microsoft developing these kinds of frameworks. I'd rather have a Microsoft that stays within well defined boundaries: that would allow projects like nHibernate to prosper.

Jody: I do know CSLA.Net and I do feel that for large projects, it's better to build a custom solution (out of existing blocks of functionality) then having to adhere to the mindset of Rocky (which doesn't mean I do not agree with his mindset, merely that I'd want to have a custom fit!)
Ruurd Boeke
Tuesday, January 22, 2008 6:56:56 PM (Romance Standard Time, UTC+01:00)
In my opinion EF isn't ready for prime time.

I hope they make many changes before they ship the product,
but this may hit projects already using a current EF version.

o PI, as you mentioned, is far from being realized.

o ComplexType columns must not be foreign keys.
Even the simplest CT examples like Address (CountryID) or Money (CurrencyID) need FK columns.

o The design tools are nice, but if one want's to use features not supported by the designers, the mapping files have to be tweaked manually and this is a burden.
- Three mapping files (or sections) for one mapping.
- Very verbose mapping syntax especially compared to NHibernate - results to thousands of lines for just a few tables
- automatic mapping update from store can't be limited to ssdl only, but makes changes to csdl an msl as well

+ I found the mapping scenarios supported by NHibernate impressive.

While I would like to use an OR-Mapper shipped by MS as part of the .NET framework I would not like using EF as it is right now.

I'm quite new to the OR-M topic and played just a little with NHibernate and EF.

Another OR-Mapper I plan to evaluate is Genome (http://www.genom-e.com/).
I read the docs but have played less with Genome than EF or NHibernate and can not tell much about.
But what I have read was encouraging.
Tuesday, January 22, 2008 7:10:02 PM (Romance Standard Time, UTC+01:00)
I agree on your comments however, in my experience, it is more important to align yourself with the microsoft tools then it is to get that little bit more power by using some piece of technology that's hard to find experienced ppl for.

But, as you can see, that's all from the perspective of big development teams. It's just more important to get developers that are already used to a technology versus having to train them. I think EF is powerful enough to get there.
As a side note though: nHibernate is steadily gaining acceptance, so maybe this argument is mute when you use nHibernate!
Ruurd
Tuesday, January 22, 2008 7:11:29 PM (Romance Standard Time, UTC+01:00)
and maybe genome-e as well.. it looks very good!
Ruurd
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):