具有工厂模式的Web服务。 C#

时间:2013-06-04 15:34:27

标签: c# web-services factory-pattern

我有以下服务:

  class SalesChannelService
{

    private static readonly ILog log = Logger.GetLog(typeof(SalesChannelService));
    protected readonly ProgressManager _progressManager;
    private readonly  ISalesChannelService _salesChannelService;


    public SalesChannelService(SalesChannelServiceFactory.SalesChannelServiceType salesChannel)
    {
        _salesChannelService = SalesChannelServiceFactory.GetSalesChannelService(salesChannel);
    }


    public IList<Order> GetSalesChannelOrders()
    {
        return _salesChannelService.GetSalesChannelOrders();    
    }

}

您认为这是正确的方法,而不是为ISalesChannelService的每个实现创建多个SalesChannelServices吗?

或者是否有其他适合此类型的模式?

由于 尼尔

0 个答案:

没有答案