为什么要保持WCF实现与单独的ServiceHost? [英] Why to keep WCF Implementation and ServiceHost separately?

查看:227
本文介绍了为什么要保持WCF实现与单独的ServiceHost?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是保持具有WCF项目效益 - 虚拟主机项目,服务项目Implementaiton单独

What is the benefit to keep the WCF project having - WEB HOST PROJECT and Service Implementaiton project separately.


  1. 服务合同库

  2. 服务实现库

  3. 服务主机项目

我理解合同和Implementaiton保持独立的意愿,有助于SOC本金和允许另外如果需要实现接口使用到其他应用程序。

I understand Contract and Implementaiton to keep separate will helpful for SOC principal and allow to use into other application also if require to implement interfaces.

不过,我不明白为什么让 - 单独服务的主机和服务Implmentation项目

But,I am not understand why to keep - Service Host and Service Implmentation project separately.

我经历了下面的链接,但不明白保持这种独立的利益。
http://www.devx.com/$c$cmag/Article/39837(第4,5)

I went through below link, but not understand the benefit of keeping this separate. http://www.devx.com/codemag/Article/39837 (Page 4,5)

如果这里的任何一个导则,它是有帮助的。

If any one guide here then, it is helpful.

感谢您

推荐答案

正如文章说:

从主机解耦服务可以让您的托管服务,你想要的任何类型的主机,并更改主机的任何时间即可。现在,主机可以是一个IIS应用程序,Windows激活服务,或任何自托管应用程序,包括控制台应用程序,Windows窗体应用程序,Windows服务等 - 的 WCF手工方式......正确的做法:第3页

Decoupling the services from the host lets you host your services in whatever type of host you want, and to change that host any time. Now, the host could be an IIS application, Windows Activation Services, or any self-hosting application including console applications, Windows Forms applications, Windows Services, etc. - WCF the Manual Way…the Right Way : Page 3

测试嘲讽的,虽然很重要,可以说是适用于大多数的事情编程明智的。更重要的是这里有用但是是多么的离职有助于在部署说服务的生产,它不是如何帮助开发人员级别的测试。后者仅用于相对于系统的生产中的工作寿命,其中操作人员可改变服务如何托管短时间内有用。操作,从资产负债管理的角度来看,持续的方式SDLC完成后。

Test mocking, though important, arguably applies to most things programming wise. What is more useful here however is how service separation helps to deploy said services in production, not how it helps developer-level testing. The latter is only useful for a short time period compared to the operational life of the system in production where operations staff may change how the service is hosted. Operations, from an ALM perspective, continues way after SDLC completes.

虽然这里题外话,我们可以走得更远和分离业务逻辑本身不仅从服务的合同,但也从任何WCF相关。正如托马斯Erl的书提到的SOA设计模式 -

Though off topic here, one can go further and decouple service logic itself not only from the service's contract but also from anything WCF-related. As mentioned in Thomas Erl's book SOA Design Patterns -

门面逻辑放置在合同和核心服务逻辑之间。这允许核心服务逻辑,以保持从合同脱钩。 - 服务外观

Facade logic is placed in between the contract and the core service logic. This allows the core service logic to remain decoupled from the contract. - Service Façade


  • 保持WCF实现和WCF宿主进程分开允许你改变它是如何托管以后

  • 高级:保持WCF实现和业务处理逻辑分离,确保后者可以自由改变不会影响公开的服务合同的用户

这篇关于为什么要保持WCF实现与单独的ServiceHost?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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