2
我有一個接口ICustomerService:從界面定義中分離wcf服務契約是否有任何價值?
public interface ICustomerService
{
CustomerList FindAll();
}
,並實現該接口的具體類。現在我需要使用WCF /休息暴露在網上的方法,我已經不得不改變接口定義的:
[ServiceContract]
public interface ICustomerService
{
[OperationContract]
[WebInvoke(
Method = "GET",
UriTemplate = "Customers")]
CustomerList FindAll();
}
我的問題是,如果有任何缺點有這些屬性附加到您的接口如果有客戶想要使用dll引用的實現而不是使用其餘的api?我知道使用REST的缺點就像必須將參數設置爲類型字符串(如果它在uri中)。