存储Proc vs EF vs NHibernate vs SQLCommands [英] Stored Proc vs EF vs NHibernate vs SQLCommands

查看:73
本文介绍了存储Proc vs EF vs NHibernate vs SQLCommands的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过很多关于CRUD操作的例子。大多数使用存储过程。

我怀疑的是,这些示例是否使用存储过程来轻松了解如何为CRUD操作开发表单,或者这是否是在专业项目中使用的最佳实用方法。我的意思是,最常用和最好的CRUD操作方式。

这是因为我看到其他方式如下:

*实体框架

* NHibernate

*使用查询SQLCommands(DataAdapters,DataTables,...)



我想听听你的意见!

解决方案

< blockquote> Entity Framework是非常成熟的框架,将是您最好的选择。我们将它用于非常大的项目,它工作得很好。如果您的应用程序很简单,并且您希望完全控制所发生的情况,那么您可以使用DataReader获得最佳性能。



存储过程对于大多数现代应用程序都是反模式的,因为它迫使您将一些业务逻辑移动到数据库层,这很快就会成为瓶颈。这是一个很好的方法,几年前整体服务器性能不是很好,不再是。


I've seen a lot of examples for CRUD operations. Most using Stored Procedures.
My doubt is if these examples are using Stored Procedure to make easy get the idea of how to develop a form for CRUD operations or if this is the best practical to use in professional projects. I mean, the most used and best way to do CRUD operations.
That's because I see others ways like:
* Entity Framework
* NHibernate
* Use the query in SQLCommands (DataAdapters, DataTables, ...)

I'd like to hear your opinions!

解决方案

Entity Framework is very mature framework and will be your best bet. We use it for very large projects and it works just fine. If your application is simple and you want complete control of what happens, then you can use DataReader for the most optimal performance.

Stored procedures are anti pattern for most of the modern applications as it forces you to move some business logic to a database layer which can quickly become a bottleneck. It was a good approach years ago when overall server performances wasn't that great, not anymore.


这篇关于存储Proc vs EF vs NHibernate vs SQLCommands的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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