Service Contract Implements another Interface

前端 未结 2 998
醉酒成梦
醉酒成梦 2021-01-25 07:09

Please tell me if this is possible. I have a client win form app and a wcf app in C#. This is my model.

Common Project

public interface IServiceA
{
            


        
2条回答
  •  旧时难觅i
    2021-01-25 07:28

    Couple of points:

    • Your client does not need to implement IServiceA. Why is that? Your client can consume the service by just having reference to your WCF service.
    • Your interface IServiceA seems to be redundant in a given scenario. It is not bringing any benefit with it. IMO you can live IGetData. This is where you are implementing the service contract. If you wish you can rename this interface as IServiceA.

    To answer your point where you have lots of module which need to get data from service, can you categorize these modules in business/function nature? If yes, then you can create different WCF service for each of those business/function and respective modules will call respective service. Further to this I don't see a point why one module should not be allowed to gather data from more than one service. That is perfectly acceptable scenario.

    HTH

提交回复
热议问题