I (highly) agree with the thoughts of marvelTracker (and Ayende).
Here is another information:
Key strategies
There is a known cost when using GUIDs as primary keys. It was described by Jimmy Nilsson, and it was publicly available at http://www.informit.com/articles/article.aspx?p=25862 . NHibernate supports the GUIDCOMB primary key strategy. However, to achieve this, EntityFramework is a bit complicated and additional steps are required.
Transfers
EntityFramework does not support enumerations natively. Until June, CTP, which adds support for Enums http://blogs.msdn.com/b/adonet/archive/2011/06/30/walkthrough-enums-june-ctp.aspx , the only way to match enums is to use workarounds. See: How to work with Enums in the Entity Framework?
Inquiries
NHibernate offers many ways to request data:
- LINQ (using re-motion re-linq provider, https://www.re-motion.org/web/ )
- Named Queries Encapsulated in Query Objects
- ICriteria / QueryOver for queries where criteria are not known in advance
- Using QueryOver forecasts and aggregates (in cases we only need specific properties of the object. In other cases, we may need the results of an aggregate function, such as average or quantity):
- PagedQueries: try to avoid user suppression and increase application performance; large result sets are usually divided into smaller pages of results.
- MultiQueries that combine multiple ICriteria and QueryOver queries into one roundtrip database
- Individual requests that are request objects in parts of the application without access to the NHibernate session. These objects are then executed elsewhere with the session. This is good because we can avoid complex repositories with many methods.
ISessions QueryOver:
Private QueryOver:
// Full reusable query! var query = QueryOver.Of<Premise>(); // Then later, in some other part of ther application: premises = query.GetExecutableQueryOver(session).List(); // Could pass IStateleSession too.
Open source
NHibernate has many contributing projects available at http://sourceforge.net/projects/nhcontrib/
This project provides a number of very useful extensions for NHibernate (among others):
- Cache Providers (for L2 Cache)
- Dependency Injection for Objects without a Default Constructor
- Full Text Search (Lucene.NET Integration)
- Spatial Support (NetTopologySuite Integration)
Support
EntityFramework comes with Microsoft support. NHibernate has an active community:
Also, see: http://www.infoq.com/news/2010/01/Comparing-NHibernate-EF-4
source share