Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
443 views
in Technique[技术] by (71.8m points)

linq - Some suggestions on which .NET ORM to look at learning

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.

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.

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 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.

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.

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...