WCF数据服务作为数据访问层? [英] WCF Data Services as Data Access Layer?

查看:123
本文介绍了WCF数据服务作为数据访问层?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在根据概念验证为我的公司制定有关WCF服务的参考架构。

I'm working on an reference architecture for my company regarding WCF Services, based on a proof of concept.

基本层由.NET架构定义准则v2并使用WCF服务软件工厂创建。这意味着以下结构:

The basic layers are defined by the .NET Architecture Guidelines v2 and created using the WCF Services Software Factory. This means the following structure:

客户端 - ServiceInterface - ServiceImplementation - BusinessComponents - DataComponents - SQL

Client - ServiceInterface - ServiceImplementation - BusinessComponents - DataComponents - SQL

目前DataComponents包含用于从SQL检索数据的EF模型,但我想知道是否应该使用WCF数据服务。这意味着WCF服务和SQL数据库之间的额外层,即点击
 性能。另一方面,它增加了解决方案的灵活性。

At the moment the DataComponents contain the EF model to retrieve the data from SQL, but I was wondering if I should use the WCF Data Services for that. This would mean an extra layer between the WCF Service and the SQL database, that hits the performance. On the other hand it adds flexibility to the solution.

我一直在寻找我会或不会使用这种方法的原因。如上所述它会影响性能,但另一方面,数据库中的更改并不一定意味着我必须更新WCF服务,因为它可以由
WCF数据服务处理。

I have been looking for reasons why I would or wouldn't use such an approach. Like described it hits the perfomance, but on the other hand a change in the database doesn't necessarilly mean I have to update the WCF service because it can be handled by the WCF Data Service.

使用或避免将WCF数据服务用作数据访问层的正当理由是什么?

What are valid reasons for using or avoiding WCF Data Services as a data access layer?

 

 

推荐答案

你好,



数据访问应该是与数据库交互的单独程序集。当我们谈论业务组件时,业务组件应该只与数据访问层进行通信,业务层是业务规则和
业务功能在此处添加的层。如果您的软件项目具有业务功能,则需要添加此层。



案例一流程图



WCF服务< ==> DAL< ===> SQL数据库(当它们没有业务组件时)



案例二流程图




WCF服务< ==> BLL< ==> DAL&NBSP; < ==> SQL数据库(当他们的业务组件)



请创建最适合您的软件项目的概念证明。



问候,



Phijo Mathew Philip。
Hello there,

Data access should be separate assembly which is interacting with database. When we are talking about the business component , the business component should be only talking to the data access layer,in the business layer is the layer where business rule and business functionality are added here. You need to add this layer if you have business functionality for your software project.

Case One flow diagram

WCF SERVICE <==> DAL <===> SQL DATABASE ( WHEN THEIR IS NO BUSINESS COMPONENT)

Case two Flow Diagram


WCF SERVICE <==> BLL <==> DAL  <==> SQL DATABASE (WHEN THEIR BUSINESS COMPONENT)

Please do create Proof of concept which is best for your software project.

Regards,

Phijo Mathew Philip.


这篇关于WCF数据服务作为数据访问层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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