关于.NET ORM 学习的一些建议 [英] Some suggestions on which .NET ORM to look at learning

查看:17
本文介绍了关于.NET ORM 学习的一些建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点惭愧地说我从未使用过 ORM;您可能还记得,我的大部分职业经历都是使用经典 ASP 进行黑客攻击,而我所做的小 .NET 往往仅用于维护.

I am a little ashamed to say that I have never used an ORM; as you may recall most of my career experience is hacking around with Classic ASP and the little .NET I do tends to be maintenance only.

为了我自己的职业生涯以及为工作中的新项目做准备(最终在 .NET 中完成!)在 TDD 期间,我正在为这个项目做准备.

For my own career as well as in preparation for a new project at work (done in .NET finally!) I'm looking at adding an ORM to my skillset - being the masochist I am I'm also going to look at TDD while I'm at it for this project.

无论如何,我在项目中使用 .NET 3.5(或计划,无论如何),所以我试图决定我想要选择什么 ORM;就像我说的,我对他们并不是很熟悉,但我大致知道他们应该做什么以及他们如何做.我的选择基本上是 NHibernate 或 LINQ/Entity Framework.我没有用过,但我看过一些 LINQ2SQL 和 NHibernate 的演示.

Anyways, I am using .NET 3.5 for the project (or plan to, anyways) so I am trying to decide what ORM I want to choose; like I said I am not really familiar with them but I know generally what they are supposed to do and how they do it. My choices are basically down to NHibernate or LINQ/Entity Framework. I haven't used any, but I've seen some demos of LINQ2SQL and of NHibernate.

NHibernate 似乎整体更健壮(Linq2Sql 甚至不是真正的" ORM),并且在 ALT.NET 社区中大量使用,我想进一步探索.但是,EF 是 Microsoft 的产品,因此,大多数开发团队都会大量使用 EF,他们只使用 Microsoft 提供的任何东西,不考虑任何替代方案.

NHibernate seems like it's more robust overall (Linq2Sql isn't even a "true" ORM) as well as heavily used in the ALT.NET community, which I want to explore more. However, EF is Microsoft's offering and, as such, will be heavily used by the majority of development teams out there who just use whatever Microsoft comes out with and don't look at any alternatives.

我听说过关于 EF 的好事和坏事,但如果/当我在一家拥有真正开发团队.

I've heard both good and bad things about EF, but I want to pick something that will give me a good foundation as well as look good to other employers if/when I find a better job in a company with a real development team.

我应该补充一点,如果选择 ORM 有任何关系,应用程序将不得不处理现有的数据库.

I should add that, if it matters any in picking an ORM, the application will have to deal with an existing database.

编辑(02/15/2009 6:48 PM):它将使用的唯一数据库是 SQL Server 2005 Standard,在 Windows Server 2003 上运行.鉴于这是一个工作项目,我的目标是选择一些不会让我花很长时间才能上手的东西(因为我需要提高效率并且学习新工具"对管理人员来说看起来不太好)但是比滚动我自己的 DAL 更好的东西.当时我还没有决定应用程序是智能客户端还是 ASP.NET 应用程序,但其中一个部分很可能会用 ASP.NET MVC 来完成.

EDIT (02/15/2009 6:48 PM): The only database it will use is SQL Server 2005 Standard, running on Windows Server 2003. Given that this is for a project for work, my goal is to pick something that won't take me a very long time to get up to speed with (as I'm going to need to be productive and "Learning a new tool" won't look good to managemetn) but something that will be better than rolling my own DAL. At the time I haven't decided if the application will be a smart client or an ASP.NET application, but one part of it is more than likely going to be done with ASP.NET MVC.

推荐答案

我会推荐 nhibernate - 因为它是开源的并且有一个非常活跃的社区帮助很容易获得.一个很好的起点是 NHibernate FAQ,它的范围从初学者的帖子到非常高级的概念.阅读并关注 为 NHibernate 准备系统你的第一个基于 NHibernate 的应用程序.

I would recommend nhibernate - since it is open source and has a very active community help is easy to get. A great starting point is The NHibernate FAQ, it ranges from post for beginners to very advanced concepts. Hit the ground running by reading and following Prepare your system for NHibernate and Your first NHibernate based application.

我工作的所有雇主都使用 NHibernate for ORM in .NET 和 Hibernate for ORM in Java - 所以你应该从学习 NHibernate 中受益匪浅.

All employers that I worked for used NHibernate for ORM in .NET and Hibernate for ORM in Java - so you should benefit greatly from learning NHibernate.

这篇关于关于.NET ORM 学习的一些建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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