微软企业库

发布于 2025-01-05 20:00:29 字数 214 浏览 0 评论 0原文

当我转向 Microsoft Enterprise Library 获取 DAAB 时,我会遇到哪些问题?换句话说,我现在似乎在没有它的情况下开发得很好 - 我正在使用 ADO .net 实体框架来访问我的 SQL 数据库,但显然对处理数据访问的新的/更有效的方法持开放态度,如果它们值得的话。我似乎找到的唯一文章针对的是更高级的开发人员,所以有人可以给我一些解释,说明企业库实际上提供了哪些我现在可能错过的内容?

What problems would I have had to come up against for me to turn to Microsoft Enterprise Library for its DAAB? In other words, I seem to be developing fine without it now - I'm using ADO .net entity framework to access my SQL database but obviously open to new/more efficient ways of dealing with data access if they're worth it. The only articles I seem to have found are aimed at the more senior level of developer so can anyone please give me a little explanation of what Enterprise Library actually provides that I may be missing out on now??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

So要识趣 2025-01-12 20:00:29

当你编码时,出于多种原因,你不应该重新启动轮子。最重要的是,当您重复使用时,您使用的是已经过开发社区审查并普遍接受的东西。 EL 库旨在简化执行常见操作(如异常处理、数据访问、日志记录等)所需编写的代码量。

数据访问应用程序 而言,

  1. 它 有许多好处:迫使您从底层数据库和类型中抽象出自己,从而允许您从一种数据库和类型转移到另一种数据库和类型。这也迫使您标准化产品中数据的访问方式。
  2. DA 还允许您简单地定义数据库并以通用方式访问它,让 DA 来处理连接和查询数据库的管道。
  3. 最后,它还可以帮助初级开发人员,因为他们不必为不同的数据库编写代码,他们使用一个界面,并且可以在各种平台上工作。

缺点是,一般来说,位于 ADO.NET 之上的任何框架都会比较慢,如果您不打算执行上述任何操作,则可能不需要使用它。

关键字是“企业”。

When you are coding you should never re-event the wheel for many reasons. Most importantly when you re-use you are using something that has been reviewed and generally accepted by the development community. EL is library is designed to simplify the amount of code you need to write to do common things like exception handling, data access, logging, etc.

In the case of Data Access Application of the many benefits:

  1. it forces you to abstract your self from the underlying database and types allowing you to move from one to another. This also forces you to standardize how your access your data in your product.
  2. DA also allows you to simply define your database and access it in a generic fashion, leaving DA to deal with the plumbing of connecting and querying your database.
  3. Lastly it also helps junior level developers because they dont have to code to different databases, they use one interface and it will work on various platforms.

Drawbacks, in general any framework that sits above ADO.NET will be slower, and if you are not planning on doing any of the above, you might not need to use it.

Keyword is "enterprise."

菩提树下叶撕阳。 2025-01-12 20:00:29

在之前的线程中,例如这个线程,共识似乎是对于大多数中小型项目来说,企业库通常过度设计。由于我在这里读过的帖子,我什至没有看过它。

In previous threads, such as this one, the consensus seems to be the the Enterprise Library is generally heavily over engineered for most small to medium projects. I have not even looked at it due to threads that I have read here.

绅士风度i 2025-01-12 20:00:29

您必须意识到 - Entlib 的数据访问块的设计和发布早于实体框架几年。当时的目标是自动处理连接字符串并正确清理 ADO.NET 对象,而 DAAB 在这方面确实做得很好。

但这几乎就是它的全部作用。实体框架为您提供建模工具和 ORM 层。如果您对此很有效率,并且它的速度足以满足您的需求,那么我不会放弃 EF 而转而使用 Entlib。

如果您发现自己需要进行原始 ADO.NET 编程,Entlib 是一个很有价值的工具。但如果没有充分的理由,我不会下降到那个水平。

You have to realize - Entlib's data access block was designed and released years before Entity Framework. At the time, the goal was to automate connection string handling and proper cleanup of ADO.NET objects, and the DAAB does do a pretty good job at that.

But that's pretty much all it does. Entity Framework gives you modelling tools and an ORM layer. If you're productive with that, and it's fast enough for your needs, I'd not drop EF in favor of Entlib.

If you find yourself needing to do raw ADO.NET programming, Entlib is a valuable tool. But I wouldn't drop down to that level without a good reason.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文