博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LINQ to SQL vs. NHibernate
阅读量:4315 次
发布时间:2019-06-06

本文共 2077 字,大约阅读时间需要 6 分钟。

To be honest, I have to say that my next project will use NHibernate for its persistence technology instead of LINQ to SQL. Why? It is a large project, with a significant number of entities, and we want to support fine-grained object models and table per sub-class mapping strategies. We also wanted the insurance of being able eager fetch on a query-by-query basis and have a 2nd level cache. It is an old adage but 'there is no silver bullet'. I'm picking one tool out of the kit, it does not mean the others are not valuable.

At the same time LINQ to SQL still forms part of our strategy, because we believe it to be simpler to approach for many projects.So we also have and will be using LINQ to SQL. If anything LINQ to SQL replaces for us which we used for a number of projects where we had good table to entity affinity. Ironically perhaps WORM was an implementation of the proposed interface for ObjectSpaces. was the MS ORM for .NET 2.0, that never saw the light of day. , and , so it seems a natural inheritor. Let us hope it does not meet the ObjectSpaces fate of being sidelined for a more grandiose vision of data access.

A valid question might be to ask why I want improve LINQ to SQL, why I do not just tell everyone to use NHibernate. Some of this is a recognition of the market, many people will not use a non-MS ORM and LINQ to SQL is is a solid ORM. Pragmatically we are likely to get more .NET developers who know LINQ to SQL available in the market place than NHibernate developers. But I also believe that with the expressiveness of LINQ MS have a real chance to move the ORM market forward in the .NET space. LINQ to SQL is like ASP.NET MVC, it is a welcome acknowledgement from MS of what developers want, and we should commend them when they do get it right.

I will be posting a series on NHibernate going forward, so that you can make your own judgements on which to use and when.

from http://codebetter.com/blogs/ian_cooper/archive/2008/07/01/architecting-linq-to-sql-part-10.aspx

转载于:https://www.cnblogs.com/baixingfa/archive/2008/08/07/1263234.html

你可能感兴趣的文章
oo第一次博客总结
查看>>
android 入门-本地化语言
查看>>
【BZOJ】【3757】苹果树
查看>>
莫比乌斯函数&莫比乌斯反演
查看>>
8 并发编程-(线程)-多线程与多进程的区别&Thread对象的其他属性或方法
查看>>
看到第三条眼眶已经湿了
查看>>
记一次CentOS7进单用户模式修改密码的失败经历(faild to load SELinux policy freezing)...
查看>>
shh整合后web.xml、spring配置文件和struts.xml的内容
查看>>
ExportToExcel SharePointSolutionInstaller
查看>>
C# 发送邮件内容嵌入图片
查看>>
HMACSHA512
查看>>
C#实现office文档转换为PDF或xps
查看>>
关于MVC整理
查看>>
etcd使用经历
查看>>
力扣 报错 runtime error: load of null pointer of type 'const int'
查看>>
angular_directive的controllerAs
查看>>
Ubuntu下修改为永久DNS的方法
查看>>
BabeLua常见问题
查看>>
Javascript 中 == 和 === 区别是什么?
查看>>
conductor 事件处理程序
查看>>