简体   繁体   English

为什么ServiceBehavior是Service Class的属性而不是Contract?

[英]Why is a ServiceBehavior an attribute of the Service Class and not the Contract?

I've found plenty of places where people point out that a ServiceBehavior should be an attribute of the service class and not the contract, and this definitely seems to be the case. 我发现很多地方人们都指出ServiceBehavior应该是服务类的属性而不是契约,这看起来确实如此。 Why is this? 为什么是这样?

Because it deals with implementation detail of the service and is not part of the contract . 因为它涉及服务的实现细节 ,而不是合同的一部分

Behaviours such as session, re-entry,... all deal with the implementation so that you could have the same contract (interface) but different implementations exposed at different endpoints. 会话,重新进入等行为都涉及实现,因此您可以拥有相同的合同(接口),但在不同的端点上暴露不同的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM