替代品在SOA转换层:WCF [英] Alternatives for Translation Layer in SOA: WCF

查看:182
本文介绍了替代品在SOA转换层:WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务不是面向对象的。假设我有一个基础的OOAD设计。我们可以将其转换成DTO(即不具有任何行为)使用的转换层。但是,这可能会导致在了code量非常大的提高。什么是这个(通过C#)的另类想法WCF?

请让您的评论是否是有SOA和OOAD之间的这种过渡好主意。我们应该避免OOAD干脆当我们有SOA或使用这样的映射技术?

这是个好主意,以创建工作的具体DTO,而不是创造DTO直接从域中删除后的行为?是否有操作的具体DTO办法?

任何工具

请问AutoMapper产生操作的具体DTO和DTO从没有表现领域?

注:具体操作方法DTO可以参照的答案在<一个href="http://stackoverflow.com/questions/9470013/do-not-use-abstract-base-class-in-design-but-in-modeling-analysis">Do不要在设计抽象基类;但在建模/分析

服务层准则提取

  

设计改造对象的业务实体和数据契约之间的转换。

参考

  1. <一个href="http://stackoverflow.com/questions/9526476/how-to-restrict-web-service-data-contract-properties-based-on-user-role">How基于用户角色来限制网络服务的数据契约性质
  2. SOA问题:揭露实体
  3. <一个href="http://stackoverflow.com/questions/5898779/what-is-the-best-way-of-using-dtos-in-a-soa-application">What是使用的DTO的SOA应用程序的最佳方法是什么?
  4. <一个href="http://stackoverflow.com/questions/11681475/wcf-message-data-contract-dto-domain-model-and-shared-assemblies">WCF消息和;数据合同,DTO,领域模型和共享组件
解决方案

与软件开发(尤其是建筑)其他事物一样,有没有一个单一的,正确的这些问题的答案。这取决于建筑的目标和限制。

WCF作品的DTO。虽然有可能下降到一个更原始层和直接与信息工作,对所有实际问题,DTO的是与WCF工作的基本组成部分。由于WCF似乎是在这种情况下,建筑的制约因素之一,真的没有切实可行的方法,以避免DTO的。

现在的问题就变成了:应该有一个映射层或不

这个问题是很容易回答,如果我们可以回答另一个问题:从测绘什么

如果您已经有一个现有的系统,你需要对现有系统和WCF边界之间进行转换。在这样的情况下,需要一个转换层

如果你正在建设一个全新的系统,也许会更容易不转换。

Services are not object-oriented. Suppose I have a OOAD based design. We can convert it into DTO (that does not have any behavior) using a Translation Layer. But this can cause be very big increase in amount of code. What are the alternative ideas for this in WCF (via C#)?

Please have your comment whether it is good idea to have such a transition between SOA and OOAD. Should we avoid OOAD altogether when we have SOA or use such mapping techniques?

Is it a good idea to create "Operation Specific DTO" rather than creating "DTO directly from domain after removing behavior" ? Is there any tool for the "Operation Specific DTO Approach"?

Does AutoMapper produce "Operation specific DTO" or "DTO from domain without behavior"?

Note: Operation specific DTO approach can be referred in the answer in "Do not use Abstract Base class in Design; but in Modeling/Analysis"

Extract from Service Layer Guidelines

Design transformation objects that translate between business entities and data contracts.

REFERENCES:

  1. How to restrict web service data contract properties based on user role
  2. SOA Question: Exposing Entities
  3. What is the best way of using DTOs in a SOA application?
  4. WCF Message & Data Contract, DTO, domain model, and shared assemblies

解决方案

As with everything else in software development (and particularly architecture), there's not a single, correct answer to those questions. It depends upon the architectural goals and constraints.

WCF works with DTOs. While it's possible to drop down to a more primitive layer and work directly with messages, for all practical concerns, DTOs are a fundamental part of working with WCF. Since WCF seems to be one of the architectural constraints in this case, there's really no practical way to avoid DTOs.

The question then becomes: should there be a mapping layer or not?

That question is fairly easy to answer if we can answer another question: mapping from what?

If you already have an existing system, you'd need to translate between the existing system and the WCF boundary. In such a case, a translation layer is required.

If you are building a completely new system, perhaps it'll be easier not to translate.

这篇关于替代品在SOA转换层:WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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