SOA架构的数据访问 [英] SOA architecture data access

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

问题描述

在我的SOA架构,我有几个 WCF服务。结果
我所有的服务都需要访问数据库。搜索结果
我应该创建负责所有的数据库访问一个专门的WCF服务?结果
或者是确定的,如果我的每个服务都有自己的数据库访问?结果

In my SOA architecture, I have several WCF services.
All of my services need to access the database.

Should I create a specialized WCF service in charge of all the database access ?
Or is it ok if each of my services have their own database access ?

在一个版本中,我只有一个实体层中一个服务实例化,和所有其他服务的取决于此服务。结果
在另外一个实体层的复制在我的每个服务。

In one version, I have just one Entity layer instanced in one service, and all the other services depend on this service.
In the other one the Entity layer is duplicated in each of my services.

第一个版本的主要缺点是在耦合感应。结果
其他版本的缺点是层的复制,也许SOA不良做法?

The main drawback of the first version is the coupling induced.
The drawback of the other version is the layer duplication, and maybe SOA bad practice ?

那么,你怎么这么认为堆栈溢出的好人?

So, what do so think good people of Stack Overflow ?

推荐答案

只是我个人的看法,如果你对所有数据库的访问则多个服务依赖于一个服务哪种类型的失败SOA点创建服务(即服务是自治区),因为你已经阐明。当你谈论层的重复,如果每个服务都有自己的数据处理,是不是真的重复。我知道你可能有你的关系数据库或后从OOA日子里,你有一个共同的类库,封装数据访问您交互的同样的手段。这是那些东西,我与自己的斗争,但我看到有它自己的数据层中每个服务没有问题。事实上,在<一href=\"http://books.google.com/books?id=-AUyj6S7etwC&dq=bustamante+WCF&printsec=frontcover&source=bn&hl=en&ei=1XXwSqDlGIa1tgfl8oD6Bw&sa=X&oi=book%5Fresult&ct=result&resnum=4&ved=0CBgQ6AEwAw#v=onepage&q=&f=false\">Michele布斯塔曼特的书(第1章 - 第8页) - 她居然描述了这个,并增加了服务封装了业务组件和数据访问。如果您发现每个服务都有一个独立的DALC层。这是一个很好的问题。

Just my personal opinion, if you create a service for all database access then multiple services depend on ONE service which sort of defeats the point of SOA (i.e. Services are autonomous), as you have articulated. When you talk of layer duplication, if each service has its own data to deal with, is it really duplication. I realize that you probably have the same means of interacting with your relational databases or back from the OOA days you had a common class library that encapsulated data access for you. This is one of those things I struggle with myself, but I see no problem in each service having its own data layer. In fact, in Michele Bustamante's book (Chapter 1 - Page 8) - she actually depicts this and adds "Services encapsulate business components and data access". If you notice each service has a separate DALC layer. This is a good question.

这篇关于SOA架构的数据访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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