大型 WCF 服务的最佳实践? [英] Best practice for large WCF service?

查看:33
本文介绍了大型 WCF 服务的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写包含大量 OperationContracts 和 DataContracts 的相当大的 wcf 服务的最佳实践是什么?

What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?

我如何将功能区域分成几个合同,最好为每个功能区域创建一个端点?

How would I separate functional areas into several contracts, would it be best to create an endpoint for each functional area?

有什么办法可以将不同部分的源分开,但仍然只为所有部分使用一种服务?

Is there any way to keep the source for the different parts apart, but still use only one service for all of them?

我从哪里获得有关如何规划合同、包含哪些内容、如何拆分...的良好信息?

Where do I get good information how to plan the contracts, what to include, how to split...?

推荐答案

自从服务问世以来,这一直是一个围绕服务的大问题.成功完成的 SOA 是按照您所说的程度进行的 SOA 计划.话虽如此,我一直更倾向于将服务拆分,但以组合方式使用它们.也就是当你有多个合约时有几个端点,但大部分只被非服务调用者消耗的少数端点消耗.(哇,那是一口,有道理吗?)

That's been a big question surrounding services since their inception. SOA done successfully is SOA planned to the extent you're talking about. Having said that, I've always leaned more toward splitting services out, but using them in a composite manner. That is, several endpoints when you have several contracts, but most of them are only consumed by a few endpoints that are consumed by non-service callers. (wow, that was a mouthful, did it even make sense?)

另外,我建议尽可能少签合同.太多的合同会导致可管理性差.好的合约设计将有助于限制端点和服务调用的数量.从合同设计中删除 OO 概念是这样做的一种方法.合同设计本身就是一个庞大的话题,但可以说,通过良好的合同规划(预先),可以带来良好的服务设计.

Also, I would advise to have as few contracts as possible. Too many contracts can lead to poor manageability. Good contract design will help limit the number of endpoints and service calls. Removing OO concepts from contract design is one way of doing so. Contract design is a massive topic in itself, but suffice it to say that through good contract planning (up front), comes good service design.

Maarten Mullender 写了一篇关于 WCF 设计的精彩博客,是必读的.还有一些很棒的 SOA/WCF 书籍也在涌现.

Maarten Mullender writes a great blog on WCF design, and is a must read. There are also some great SOA/WCF books emerging as well.

一些好书:

这篇关于大型 WCF 服务的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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