Someone at my company’s recent developers conference pointed out that a key tenet of WCF is separation of concerns. So let’s explore what this means. WCF allows you to write services, whether they be “web services” or “queueing services” or whatever type of service you need. A service is some code that you write as part of a typically larger system. The service will be consumed by another program residing anywhere you choose to expose it: on the local machine, across a LAN, over the web, etc. When you conceive of a service, you want to think about (1) what the service will do, (2) where it will be called from, and (3) what constraints (e.g., performance, security) to put on the service. Prior to WCF, .NET allowed you to create an ASP.NET web service, also called an ASMX. The developer still had to think about those three questions mentioned above but they also had to code, in the service class/method code, all of the details related to how the service would be implemented for performance, security and who could be a consumer (who in the general sense). WCF separates out these things into configuration files so that, in the process of writing the service code, you can just concentrate on what the service will do. How the service is called, how performant and secure it is, these can be defined in configuration.
Why is this so important? Say you want to expose a service to both a customer through a well-known web page interface, but you also want to expose the service to an administrative WinForms or console program running on a local LAN. Security considerations are likely to be different and knowing that the admin program is running on the LAN is also likely to influence how the service can be most efficiently called.