.NET开发应使用哪种ORM工具 [英] Which ORM tool should I use for .Net development

查看:89
本文介绍了.NET开发应使用哪种ORM工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司正在寻求将ORM用于.Net的新开发.由于nHibernate的流行,我们目前正在研究它,但是LLBLGen是我们可以考虑的另一种选择.成本不是主要因素.我们需要一种解决方案,该解决方案可以很好地将域模型与数据库区分开来,并提供良好的缓存策略,提高开发效率(即,如果我可以在GUI中而不是在配置文件中对其进行编辑,那就很好),良好的客户支持.

My company is looking to use an ORM for new development in .Net. We are currently looking at nHibernate, because of its popularity, however LLBLGen is another option that we may consider. Cost is not a primary factor. We need a solution that provides good separation of the domain model from the database, a good caching strategy, development productivity (i.e. if I can edit it in a GUI instead of config files, great), good customer support.

我知道nHibernate非常受欢迎,但是我也知道价格(它是免费的)可能是开源类型的原因之一.由于成本不是主要因素(除非价格大于10,000美元),考虑到我们的情况,您会选择哪个?另外,除了我列出的因素之外,您还认为其他什么因素对选择ORM最重要?

I know that nHibernate is very popular, but I also know that the price (it's free) may be part of that reason for open source types. Since cost isn't a primary factor (unless the price is > $10,000), which would you choose given our circumstances? Also, what other factors, other than ones that I've listed, would you consider most important in choosing an ORM?

分辨率

我们最终决定将NHibernate作为解决方案,但是事后看来,如果我们再做一次,我想我会选择LLiber.我只是找不到xml映射文件.我为NHibernate找到的代码生成器有很多不足之处.我确实发现Fluent NHibernate是一个有趣的开发,但是我宁愿等它先成熟再使用.

We finally decided upon NHibernate as a solution, however in hindsight, I think I would have gone with LL if we had it to do over again. I'm just not found of the xml mapping files. The code generators that I found for NHibernate left a lot to be desired. I do find Fluent NHibernate to be an interesting development, but I'd rather wait for it to mature first before using it.

事实证明,我学习过程中最重要的部分不是技术,而是两种设计模式:存储库和分离的接口模式.通过定义用于数据访问的存储库接口(Jeffrey Palermo上有许多博客文章,Apress和Wrox MVC书籍也都显示了这一点),我们可以使用LinqtoSQL,LLBLGen,NHibernate等,并换出DAL实现稍后,如果我们切换.因此,当我的一位同事在他的应用程序上使用NHibernate时,我选择在我最新的应用程序上使用LinqToSQL,它工作得很好.

As it turned out, the most important part of my learning process turned out not to be the technologies, but two design patterns: the repository and separated interface patterns. By defining a repository interface for data access (Jeffrey Palermo has a number of blog posts on this and both the Apress and Wrox MVC books show this as well), we can use LinqtoSQL, LLBLGen, NHibernate, etc. and swap out the DAL implementation later if we switch. So while one of my co-workers is using NHibernate on his app, I chose to use LinqToSQL on my most recent app and it worked just fine.

推荐答案

如果您不介意付款,我建议您使用LLBLGen.

If you don't mind paying, I would suggest LLBLGen.

完整功能列表此处.

从网站上

真实的数据库独立代码

True database independent code

满 实体类型继承

Linq支持

类型列表和视图

存储过程支持

灵活的并发机制

细粒度验证框架

派生表支持

这篇关于.NET开发应使用哪种ORM工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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