为什么要使用实体框架4 NHibernate的,而不是要使、实体、而不是、框架

2023-09-04 02:10:46 作者:要把难过藏起来

我试图说服我的客户端使用NHibernate的实体框架4.我的客户,而不是已经决定只使用微软的库(包括团结与企业库5)。我不同意他们(有好多日志框架/验证层/ IOC等),但尊重他们的决定。

I'm trying to convince my client to use nhibernate instead of Entity Framework 4. My client have decided to use only Microsoft libraries (including Unity and Enterprise library 5). I don't agree with them (there are so much better logging frameworks/validation layers/ioc etc) but respect their decision.

我已经打了EF4几天的,我不喜欢它,主要是因为:

I've played with EF4 for a couple of days and I do not like it, mainly because of:

所有的

首先,所有的错误信息是可怕的。我不得不花费更多的时间使用Google什么异常实际上意味着不是试图解决这些问题。

First of all, all error messages are horrible. I have to spend more time googling what the exceptions actually means than to try fix them.

我们使用POCO的,这是一个有点麻烦,使他们与EF4工作确定。

We use POCO's and it was a bit of a hassle to make them work OK with EF4.

使用的NHibernate的映射文件是这么容易的工作。

The mappings files used by nhibernate is so much easier to work with.

不要任何人有两个框架的经验,给我更多的理由,为什么他们不应该使用EF4?

Do anyone else have experience with both frameworks and give me more reasons to why they should not use ef4?

是否有可用于从一个数据库映射文件/模型的任何GUI工具或Visual Studio加载项(类似的东西总是有帮助)

Are there any GUI tools or visual studio addins which can be used to generate mapping files / models from a database (stuff like that always helps)

推荐答案

人们热议长期和深入的反应,可以做的比数sentances这里在这个论坛要好得多。看看下面或做一个谷歌搜索与NHibernate的实体框架4.0:

People have blogged long and in depth responses that can do much better than a few sentances here on this forum. Take a look at the following or do a Google search for "NHibernate vs. Entity Framework 4.0":

追问与英法4.0(实体框架)和NHibernate第1部分: http://blogs.microsoft.co.il/blogs/berniea/archive/2009/06/09/a-quest-with-ef-4-0-entity-framework-and-nhibernate-part-1.aspx http://blogs.microsoft.co.il/blogs/berniea/archive/2009/06/09/a-quest-with-ef-4-0-entity-framework-and-nhibernate-part-2.aspx

A Quest With EF 4.0 (Entity Framework) And NHibernate Part 1: http://blogs.microsoft.co.il/blogs/berniea/archive/2009/06/09/a-quest-with-ef-4-0-entity-framework-and-nhibernate-part-1.aspx http://blogs.microsoft.co.il/blogs/berniea/archive/2009/06/09/a-quest-with-ef-4-0-entity-framework-and-nhibernate-part-2.aspx

NHibernate的与实体框架4.0: http://ayende.com/Blog/archive/2010/01/05/nhibernate-vs.-entity-framework-4.0.aspx

http://stackoverflow.com/questions/1639043/entity-framework-4-vs-nhibernate