NHibernate or Linq?
来源:互联网 发布:mango db mac 编辑:程序博客网 时间:2024/04/29 00:18
First of all I want to help you to choose between NHibernate and Linq. The answer is: it doesn't matter. Both have advantages but few disadvantages. The right choice depends on your feeling. Stick to the option which feels better for you. The reason for that is:
Linq is
- part of .NET 3.5
- integrated into Visual Studio
- allows the usage of Linq and compile time error checking
- slightly faster in reading, slightly slower in writing than NHibernate
But Linq is also
- very new
- generates entity classes for you. The control over your classes is limited. Although you can extend them with partial classes and inheritance. But you don't have that much control as if you're using NHibernate.
NHibernate is
- mature with a great community in the .NET- and JAVA- world
- very easy to use
- database independent
- lightweight. You can create the entity classes yourself and the mappings
- slightly faster in saving, slightly slower in reading than Linq
- HQL queries are supported with Linq (linq to nhibernate)
But NHibernate is also
- a 3rd party library (which can be +)
- not integrated into Visual Studio
Use ORM!
NHibernate is a mature open source project designed specifically to solve ORM problems. It is an extremely flexible and configurable ORM, and its been battle-proven for many enterprise projects. It is database agnostic, and supports a wide array of different database brands. Like many active open-source projects, it is undergoing constant evolution, which makes good documentation hard to find.
You should defeniteley use a ORM mapper to build your whole application and then, if you feel that certain features lack of performance you should only switch those critical parts of your applciations to stored procs. For instance you can tell NHibernate to call stored procs for certain queries.
That's my personal opinion and I am trying to convince colleagues of using ORM instead of stored procs all the time. It's a tough quest.
- NHibernate or Linq?
- NHibernate Criteria中的And, Or
- LinqPad中使用Linq For NHibernate
- NHibernate Linq查询 扩展增强 (第九篇)
- 今天关于Linq,NHibernate等持久数据的理解
- NHibernate3剖析:Query篇之NHibernate.Linq增强查询
- NHibernate3剖析:Query篇之NHibernate.Linq自定义扩展
- NHibernate Linq 的 join (联合查询) 的例子
- NHibernate3剖析:Query篇之NHibernate.Linq自定义扩展
- NHibernate3剖析:Query篇之NHibernate.Linq增强查询
- LINQ Where with AND OR condition
- NHibernate
- nhibernate
- NHibernate
- NHibernate
- NHibernate
- Nhibernate
- NHibernate
- Linux项目生成器
- asterisk H323协议配置
- servlet标准
- 求教
- 三年心血PC120重磅推荐-解决电脑故障一定要知道的二十五个网址!
- NHibernate or Linq?
- 设计模式--原型模式(ProtoType)
- 怎样写简历及其它
- [转帖]上网必上10大网站
- 为什么大规模数据处理很少用到hash
- 网址
- const
- 近期阅读关注(200905)
- FIND命令使用