数据库抽象 - 有哪些选项?
如何从应用程序中抽象数据库,使其不知道数据库类型? 我必须设计一个 .Net 3.5 WPF 应用程序,它必须支持 SQL Server 或 Visual FoxPro 作为数据存储库。
我的设计目标是:
- 在数据访问层中编写代码时,使数据存储库的类型不可见
- 尽可能快速、轻松地在 SQL 和 FoxPro 之间切换
- 允许同时使用 ANSI SQL 和存储过程 从 DAL
- 学习曲线来看对于加入该项目的其他开发人员来说是最小的
这将是一个 WPF 应用程序,可能使用 CSLA。
我曾考虑过使用某种 ORM,但没有此类技术的经验。
How can I abstract my database from my application so that it is unaware of the database type?
I have to design a .Net 3.5 WPF application that must support either SQL Server or Visual FoxPro as the data repository.
My design goals are to:
- make the type of data repository invisible when writing code in the Data Access Layer
- make it as quick and painless as possible to switch between SQL and FoxPro
- allow use of both ANSI SQL and stored procedures from the DAL
- learning curve must be minimal for other developers joining the project
This will be a WPF application, probably using CSLA.
I have thought about using some kind of ORM but have no experience with this type of technology.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
许多 ORM 与数据库类型无关,尽管 FoxPro 要求可能会限制您的选择或要求您编写自己的提供程序或适配器。
如果您希望您的应用程序能够使用多种数据库类型(例如通过配置),您还必须注意每个数据库中的架构是兼容的,并且您不依赖于其中一种数据库中未实现的功能。数据库或您选择的 ORM 中。
我最熟悉的ORM LLBLGen Pro支持5或6个后端数据库,但FoxPro并未得到官方支持。 曾经有一位客户贡献了 FoxPro 适配器。 不知道有没有维护过。
Many ORMs are DataBase type agnostic, though the FoxPro requirement might restrict your choises or require you to write your own provider or adapter.
If you want your application to be able to work with multiple DataBase types, say through configuration, you must also be careful that your schemas in each database are compatable and that you don't depend on features that aren't implemented in one of the databases or in the ORM you choose.
The ORM I'm most familiar with LLBLGen Pro supports 5 or 6 back-end databases, but FoxPro is not officially supported. There was a customer contributed FoxPro adapter at one point. I don't know if it has been maintained.