如何选择.NET对象关系映射 [英] How to choose an object relational mapping for .net

查看:123
本文介绍了如何选择.NET对象关系映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这必须是一个常见问题,所以我希望它被关闭,重复的,但是我无法找到包含一个很好的概述问题等问题。)

(This must be a FAQ, so I expect it to be closed as duplicate, however I can not find a question that contains a good overview of the issues etc.)

什么的人应该考虑何时的选择的ORM的 .NET 系统?

What should someone consider when choosing an ORM for a .net system?

如何是上述的解决由在常见的用法。NET系统的ORM。

How are the above addressed by the ORM that are in common usage for .net systems.

(女巫堆栈溢出的问题,我应该在的答案链接到我的时候说:考虑使用ORM对于.NET的问题)

(Witch stack overflow question should I link to in an answers when I says "consider using a ORM" for a .net question)

是否在一个愿望,以提供一个新的答案,并获得奖金?

推荐答案

这是主要的问题/答案我一直指出人在问候选择.NET ORM:

This is the main question/answer I have been pointing people at in regards to choosing a .NET ORM:

<一个href="http://stackoverflow.com/questions/1377236/nhibernate-entity-framework-active-records-or-linq2sql/">http://stackoverflow.com/questions/1377236/nhibernate-entity-framework-active-records-or-linq2sql/

我放了一堆的重复类型的问题,在我的上一个答案。因此,有大量的阅读,你可以从各种不同的角度做的。

I put a bunch of the "duplicate" type questions in my answer on that one. So there is plenty of reading you can do from a variety of different perspectives.

我也将尽力回答您的具体问题:

I'll also try to answer your specific questions:

我应该考虑的人时,   选择一个ORM的.NET系统?

What should someone consider when choosing an ORM for a .net system?

  • 您要确保它与 你的数据库。如果你的数据库 设计是艺术15年的状态 前,许多的小和/或更少的成熟 奥姆斯不会与你缺乏工作 键,奇怪的关系,等等。

  • You want to make sure it works with your database. If your database design was state of the art 15 years ago, many of the smaller and/or less mature ORMs won't work with your lack of keys, weird relationships, etc.

    您要确保它与 数据库供应商。 SQL Server的 支持pretty的多少总是 可用的,但其它的数据库可以或 可能不被各种奥姆斯支持 (MYSQL似乎是第二最 普遍支持的数据库)。

    You want to make sure it works with your database vendor. SQL Server support is pretty much always available, but other databases may or may not be supported by various ORMs (MYSQL seems to be the second most commonly supported database).

    如果你想生成数据库 根据您的.NET类,你需要 确保你的ORM支持。

    If you want to generate your database based on your .NET classes, you need to make sure your ORM supports that.

    如果你想表现,我想你 远离不良表演 的人,但那些永远不会做 前5之列,所以只要你去 有一些主流的ORM 街头威望,你很可能罚款 在这里。

    If you want performance, I guess you stay away from the bad performing ones, but those would never make a top 5 list, so as long as you go with an ORM that has some mainstream street cred, you are probably fine here.

    您需要确保它有你需要支持的特性:<一href="http://ayende.com/Blog/archive/2006/05/12/25ReasonsNotToWriteYourOwnObjectRelationalMapper.aspx">http://ayende.com/Blog/archive/2006/05/12/25ReasonsNotToWriteYourOwnObjectRelationalMapper.aspx

    You need to make sure it has features you need supported: http://ayende.com/Blog/archive/2006/05/12/25ReasonsNotToWriteYourOwnObjectRelationalMapper.aspx

    考虑厂商锁定,以及如何 您轻松可能或可能不能够 逃避它(这两个数据库 供应商和ORM的供应商)。

    Consider vendor lock-in and how easily you may or may not be able to escape it (for both the database vendor and the ORM vendor).

    想想你想花多少。

    考虑你想为code什么 产生。

    Consider what you want for code generation.

    考虑你想要的单元测试是什么 支持。

    Consider what you want for unit test support.

    考虑你有多少时间要 花费在研究各种 选项​​。

    Consider how much time you want to spend researching the various options.

    考虑到存在社区 周围的ORM。

    Consider the community that exists around the ORM.

    有很多事情要记住。我敢肯定,我能想到的更多。最后,大量的是情境,你需要做出自己的决定什么是最适合你和你的项目。

    There are plenty of things to keep in mind. I'm sure I could think of more. In the end, a lot of it is situational and you need to make your own decision what is best for you and your project.

    如何上面的ORM解决   这是常见的用法。NET   系统。

    How are the above addressed by the ORM that are in common usage for .net systems.

    唯一的.NET ORM,我是知道的,满足pretty的很多都需要一个.NET项目可以有(减去比较模糊数据库厂商)是NHibernate的。它已经过测试,有很多在许多不同的场景遗产的数据库。

    The only .NET ORM that I am aware of that meets pretty much all needs a .NET project could have (minus the more obscure database vendors) is NHibernate. It has been tested with a lot of "legacy" databases in a lot of different scenarios.

    这篇关于如何选择.NET对象关系映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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