What to name a WCF Service?
I've just started looking into WCF Services (for the first time) and I need a bit of guidence on how to best design service contacts. Should these contracts be designed towards the entities within an application, e.g. IEmployee, IOrder, or more towards the processes, e.开发者_高级运维g. IWarehouse, IOrderProcessor?
I'm not sure if this question makes much sense, if not, then any examples you can provide would very much appreciated.
Kinds Regards
Sid
You should name them for processes as this is how it is conceptualized in WCF. The service interface has the ServiceContract attribute and the methods have the OperationContract attribute.
The types your service uses have the DataContract attribute, e.g. Employee.
This separation between operations and data types is one of the advantages of WCF.
精彩评论