MS Entity Framework VS NHibernate及其派生的贡献(FluentNHibernate,NHibernate的Linq) [英] MS Entity Framework VS NHibernate and its derived contribs (FluentNHibernate, Linq for NHibernate)

查看:219
本文介绍了MS Entity Framework VS NHibernate及其派生的贡献(FluentNHibernate,NHibernate的Linq)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚读了这篇 文章 关于实体框架4(实际上是版本2)。



实体框架似乎比第一个版本有了很大的改进。因此,我从来没有在任何项目中使用过EF,因为我认为EF与NHibernate相比还不够成熟。

.hibernate.org / 343.htmlrel =nofollow noreferrer> NHibernate 及其当前的贡献 FluentNHibernate < a>和 Linq for NHibernate by Ayende Rahien

我的感觉是,当NHibernate的第二个版本问世的时候,微软只是试图获得一些有利于NHibernate的地形。然而,我的担忧是以下(不特别是顺序):


  • EF4往往是较少的XML详细?

  • EF4与底层数据存储兼容吗?

  • 使用EF4代替FluentNHibernate或NHibernate本身的最大好处是什么? >


NHibernate是一个很棒的工具,我猜大家都同意。由于其前身Hibernate,我们可以很容易地找到文档,教程和示例应用程序来熟悉它。这不是FluentNHibernate的情况。特别是根据我现在正在进行的项目,这要求我进一步调查NHibernate及其选项(例如FluentNHibernate),以便记录NHibernate和FluentNHibernate技术的使用规则和最佳实践。因此,作为一个C风格的开发人员,被VB.NET手铐,我找不到在VB.NET中的一些语法等价的提供的例子,尽管我做了我的方式到目前为止。

我相信NHibernate是一个最好的选择,但是作为软件顾问,我不能(不想)错过重要的技术变革,改进和发展。

尽管我读到EF1的评论很差,EF4似乎非常有前途。大家都在想NHibernate和Entity Framework的途径吗?对于我来说,我对所有的阅读都感到困惑。我需要你把我的头从水里拿回来。



感谢大家!

解决方案

盐。我对ORM工具没有任何权威性,但是在这里呢...



我在EF中看到的最大的好处之一就是映射的GUI。国际海事组织,这节省了很多时间,但可能是为什么EF XML映射如此详细的原因。不幸的是,他们没有被人为地处理。是否会改变我不知道。我所知道的是,EF提供的图形用户界面在以前的版本中非常片面。而且我仍然听到有人抱怨说它不能很好地扩展,特别是在大型和更复杂的架构上,它们只是错过了一些事情,而最终却是直接搞乱了映射。我的观点是,随着EF的成熟,XML映射将变得不那么冗长。 EF中也有流畅的映射支持,这也是有帮助的。最后,另一个重要的事情就是能够改变EF生成的代码模板,也就是说,如果你喜欢数据库驱动的设计,而不是设计优先的方法。

另一个好处是它来自微软,他们有足够的面团,使这个真正的涂料框架。它在过去几年里发展很快。我认为在一年多的时间里,它会和NHibernate保持一致。截至目前,我认为NHibernate是一个更好的选择。这是更稳定和成熟。相对容易配置,最重要的是一个更好的表演者。我想如果你明智地设计,从一个到另一个将是一个小菜一碟。

EF只是一个抽象。我相信有Oracle的提供者,所以我不明白为什么不能随着它的增长而添加更多。


I just read this article about the Entity Framework 4 (actually version 2).

Entity Framework seems to offer a huge improvement over its first release. Thus, I have never ever used EF in any project, since I think EF is not mature enough in comparison to NHibernate.

NHibernate and its current contributions of FluentNHibernate and Linq for NHibernate by Ayende Rahien

My feeling is that Microsoft is solely trying to gain terrain it has lost in favor of NHibernate when the 2nd version of NHibernate came out. Nevertheless, my concerns are the followings (not in particular order):

  • Will EF4 tend to be less XML-verbose?
  • Will EF4 be compatible with underlying datastores other than just SQL Server?
  • What are the greatest benefits of going with EF4 instead of FluentNHibernate or NHibernate itself?

NHibernate is a great tool, I guess everyone agrees. Due to its predecessor Hibernate, we may easily find documentions and tutorials and sample applications to get acquainted with it. This is not the case for FluentNHibernate. Particularly as per the project I'm working on right now which demands that I investigate further about NHibernate and its options (FluentNHibernate for instance) in order to document the rules of usage and the best practices of NHibernate and FluentNHibernate technology. Thus, being handcuffed with VB.NET, being a C-Style developer, I can't find some syntax equivalencies in VB.NET for the examples provided, though I made my way so far.

I do believe that NHibernate is a best choice, but as a software consultant, I can't (don't want to) miss important technology changes, improvements and evolution.

Despite the bad comments I read about EF1, EF4 seems to be very promising. What you all think about both NHibernate and Entity Framework avenues? As for me, I am becoming puzzled with all that readings. I need you to bring back my head out of the water.

Thanks to you all!

解决方案

Take this with a grain of salt. I am not any kind of authority on ORM tools, but here it goes...

One of the biggest benefits that i see in EF is the GUI for mapping. IMO, this saves a lot of time, but is probably the reason why EF XML mappings are so verbose. They're not made to be dealt with manually, unfortunately. Whether it will change or not i don't know. What i do know is that the GUI that EF provides used to be very flaky in previous releases. And i still hear about people complaining that it isn't scaling well, especially on larger and more complex schemas where it just misses things and you end up messing with the mappings directly. My opinion is that XML maps will become less verbose as EF matures. You also have the fluent mapping support in EF, which is also helpful. Finally, another big thing is the ability to change code templates that EF generates, that is if you favor database-driven design instead of design-first approach.

Another benefit is that it comes from Microsoft and they have enough dough to make this a really dope framework. It has grown tremendously in the past few years. I think it'll be on the same ground with NHibernate in a little over a year. As of now, I think NHibernate is a better choice. It's more stable and mature. Relative easy to configure and most importantly a better performer. I think if you design wisely, a move from one to another is going to be a piece of cake.

EF is just an abstraction. I believe there are providers for Oracle, so i don't see why there couldn't be more added as it grows.

这篇关于MS Entity Framework VS NHibernate及其派生的贡献(FluentNHibernate,NHibernate的Linq)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆