WCF client access layer best practice
-
I have created an access layer for my application. I created a subclass of the generic ChannelFactory class to be able to separate the WCF configuration from the main application. Just wondering, is this the usual way to go about it, or is it pherhaps considered a best practice? If not, what is?
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka
-
I have created an access layer for my application. I created a subclass of the generic ChannelFactory class to be able to separate the WCF configuration from the main application. Just wondering, is this the usual way to go about it, or is it pherhaps considered a best practice? If not, what is?
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka
Usually, when I need to access WCF services from client applications, I derive from
System.ComponentModel.ClientBase<T>
for the appropriate service contract interface. This creates a client proxy for your service with the same contractual interface. I would say that deriving from ChannelFactory directly sounds like a bit of a round about way of accessing a WCF service...perhapse not 'round about', but definitely more work. If you want to abstract the service more, so your clients have a bit more independance from whatever your services are wrapping, just add another layer of classes around your proxies, and expose whatever interface meets the needs of your application (facade/adapter patterns). Then your free to change your services without screwing with your clients.