创建公共/可重用的DataBaseAcesslibrary [英] Creating common/reusable DataBaseAcesslibrary

查看:64
本文介绍了创建公共/可重用的DataBaseAcesslibrary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使我们的DataBaseAccess与所有内部/外部应用程序通用/可重用。作为访问数据库的客户端,我有许多小型控制台,窗口,Windows服务,Web服务和Web应用程序。许多应用程序部署在多个服务器中。

在此过程中,我想到的想法如下:



选项1

===========

使用Entity Framework创建DataBaseAcces并通过WCF Web服务公开所需的方法。这样,如果将来任何表结构发生变化,我只需要在一个地方更新模型,而不是更新多个地方/项目。



可以有一个性能下降。



选项2

===========

创建DataBaseAccess的类库(带有Entity Framework)并部署到每个服务器的GAC。但是如果发生任何数据库更改,这又需要重新部署到多个服务器。



此外,所有应用程序都访问相同的DataAccess层是好的,原因是由于某种原因部署了dataaccess层的服务器关闭,然后它将影响所有应用程序。





这些是我认为的选项现在。



我将非常感谢您的建议/想法/建议。

I am thinking of making our DataBaseAccess common/reusable to all our internal/external applications. I have many small console, windows, windows service, web service & web applications as clients accessing the database. Many applications deployed in multiple servers.
While in the process the thought that came into my mind is as below:

Option 1
===========
Create a DataBaseAcces using Entity Framework and expose the required methods through a WCF Web Service. This way if any table structure changes in the future, I need to update the model only in one place, instead of updating mutliple places/projects.

There can be a performance degradation here.

Option 2
===========
Create a class library for DataBaseAccess(with Entity Framework) and deploy to the GAC of each servers. But this again needs redeploying to multiple servers if any DB changes occur.

Also Is it good have all applications access same DataAccess layer, the reason being if for some reason the server where the dataaccess layer is deployed goes down, then it will affect all the applications.


These are the options I think as of now.

I would appreciate your suggestions/ideas/recommendations.

推荐答案

这篇关于创建公共/可重用的DataBaseAcesslibrary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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