ADO.NET实体框架和NHibernate - 当使用了另一种实体、框架、使用了、ADO

2023-09-04 00:26:35 作者:——凤凰情殇

我的工作在Microsoft .NET商店,它是好的使用NHibernate的或ADO.NET EF。我们应该使用什么时候你应该选择一个比其他什么指导?

I am working in a Microsoft .NET shop where it is okay to use NHibernate or ADO.NET EF. What guidance should we be using about when you should choose one over the other?

例如,它似乎写一个Silverlight应用程序的EF - 到 - > ADO.NET数据服务 - 到 - >的Silverlight将提供一个提高生产力,并为您提供一个REST服务API,因为没有额外的努力时等。

For example, it seems like when writing a Silverlight app the EF -to-> ADO.NET Data Services -to-> Silverlight would offer a productivity boost, and provide you with a REST service API for no extra effort.

还有什么其他的事情应该帮助指导你的应用程序通过应用程序的基础?

What other things should help guide you on an app by app basis?

更新(基于评论): 这一个是稍微有用 http://stackoverflow.com/questions/658824 别人走下车到怪异的切线(如亚音速)和不直接比较两个。我想我专门寻找谁通过项目的其中之一,他们将使用一个项目同时使用,并且决定的人。

UPDATE (based on comment): This one is slightly useful http://stackoverflow.com/questions/658824 the others go off into weird tangents (like SubSonic) and don't directly compare the two. I guess I'm specifically looking for people who use both, and decide on a project by project which one they will use.

推荐答案

在简单地说,英孚已经没有持续性无知的支持开箱即用。当我第一次尝试建设有EF的解决方案,去年,我有点恼火,你不能有波苏斯在您的应用程序。我想,所以我最终切换到NHibernate的一个更高的学历,我的模型脱钩。此后,有人是写的EF POCO适配器。 HTTP://$c$c.msdn.microsoft.com/EFPocoAdapter - 但是它真的只是一个codegenerator产生一个适配器层映射你的对象。

In a nutshell, EF has no Persistence Ignorance support out of the box. When i first tried building a solution with EF last year, i was a bit annoyed that you can't have POCOs in your application. I wanted a higher degree of decoupling with my model so i ended up switching to NHibernate. Since then, someone's written an EF POCO adapter. http://code.msdn.microsoft.com/EFPocoAdapter - however its really just a codegenerator that generates an adapter layer to map your objects.

出于某种原因,我的应用程序跑快一点的NHibernate下也是如此。采取与一粒盐,因为我是新来配置任何一种解决方案。

For some reason, my app ran a bit faster under NHibernate as well. Take that with a grain of salt because i was new to configuring either solution.

 
精彩推荐
图片推荐