用于处理遗留数据库的最佳 .NET 数据层框架

发布于 2024-10-01 14:54:31 字数 197 浏览 2 评论 0原文

我正在为一个非常旧的数据库建立一个网站。因为数据库是不同标准的混合体,所以我认为 ORM 不是正确的技术,而是使用存储过程和视图与其交互。

用于处理旧数据库的优秀 .NET 数据层框架有哪些?我感兴趣的功能是调用数据库存储过程的简洁代码以及从结果到强类型对象的自动映射。

轻量且简单的框架也是一个优点。我会避免使用 nHibernate 的复杂性。

I am building a website for a very old database. Because the database is a mix of different standards I've decided that an ORM isn't the right technology and will instead use stored procedures and views to interact with it.

What are good .NET datalayer frameworks for working with old legacy databases? Features I'm interested in are concise code to call the database stored procs and automatic mapping from results to strongly typed objects.

A framework that is light-weight and simple would be a plus as well. I'd to avoid something with the complexity of nHibernate.

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

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

发布评论

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

评论(3

丢了幸福的猪 2024-10-08 14:54:31

我认为对于不同数据库的最佳选择是尝试将它们合并到更新的标准中。使用 ORM 可能是可行的,我特别喜欢 DevExpress 的 XPO当你实际“编码”时,它几乎“透明”...并且它适用于很多数据库:

Access 2000、2007 (Microsoft Jet)、Advantage Database Server v9.1+、DB2、Firebird 1.5+、
MySQL Server 4.1+、Oracle 9i、10g、11g、Pervasive.SQL 9+、PostgreSQL 7+、SQL Anywhere 11+、Sybase Adaptive Server 12+、SQLite 3、VistaDB 4 和所有 SQL Server 版本...

您可以尝试 ADO .NET 与实体框架并使用 POCO 对象方法,以便您可以自己更好地控制数据层。

同样,我当然会尝试找到一种方法将所有数据合并到现代数据库中,如果您必须让遗留应用程序在旧数据库上运行,请尝试提出一个导出过程以将其数据复制到“可查询”中现代数据库后端...这样您就可以防止遗留应用程序在试图与同一遗留数据库上的网站竞争时遭受性能损失(许多遗留数据库中的并发性处理得不太好...),事实上,有时最好的设计是拥有一个与“主”工作数据库分开的“报告”数据库(网站几乎总是像一个报告层)

PS.:很抱歉在不知道您的实际问题域的情况下提出解决方案。完全...

I think the best option with disparate databases is to try to consolidate them in a newer standard. It may be feasible to use an ORM, I'm particular fond of DevExpress' XPO as you actually "code" it almost "transparently"... And it works with a LOT of databases:

Access 2000, 2007 (Microsoft Jet), Advantage Database Server v9.1+,DB2, Firebird 1.5+,
MySQL Server 4.1+, Oracle 9i, 10g, 11g, Pervasive.SQL 9+, PostgreSQL 7+, SQL Anywhere 11+, Sybase Adaptive Server 12+, SQLite 3, VistaDB 4 and all SQL Server versions...

You can try ADO.NET with Entity Framework and use a POCO objects approach so that you can have finer control of the data layer yourself.

Again, I would certainly try to find a way to consolidate all data into a modern database, if you have to have the legacy application running over the old database, try to come up with an export process to replicate its data into a "queryable' modern database back-end... This way you'll prevent the legacy application from suffering in performance trying to compete with the web-site over the same legacy database (concurrency was not that well handled in many legacy databases...), and in fact it is sometimes the best design to have a "report" database (web-sites are almost always like a report layer) separate from the "main" working database.

PS.: Sorry for suggesting solutions without knowing your actual problem domain fully...

別甾虛僞 2024-10-08 14:54:31

您可以尝试Microsoft Enterprise Library数据应用程序块。它在幕后使用 ADO.Net,但将其包装在一个更易于使用的包中。它比 NHibernate 之类的东西要轻量得多。

You could try the Microsoft Enterprise Library Data Application Block. It uses ADO.Net under the covers, but wraps it up in an easier to use package. It's a lot more lightweight than something like NHibernate.

完美的未来在梦里 2024-10-08 14:54:31

简单的 ADO.NET 怎么样?它应该支持大多数数据库。对于较旧的数据库,通常有一个 ODBC 驱动程序允许您连接到数据库。您需要支持哪些?

How about simply ADO.NET? It should support most databases. For older databases, there is usually an ODBC driver that will allow you to connect to the database. Which ones do you need to support?

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