微软企业库
当我转向 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当你编码时,出于多种原因,你不应该重新启动轮子。最重要的是,当您重复使用时,您使用的是已经过开发社区审查并普遍接受的东西。 EL 库旨在简化执行常见操作(如异常处理、数据访问、日志记录等)所需编写的代码量。
就
数据访问应用程序
而言,缺点是,一般来说,位于 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: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."
在之前的线程中,例如这个线程,共识似乎是对于大多数中小型项目来说,企业库通常过度设计。由于我在这里读过的帖子,我什至没有看过它。
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.
您必须意识到 - 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.