Wednesday, August 19, 2009

Power of WCF

WCF (Windows Communication Foundation) is Microsoft's unified programming model for building service-oriented applications that communicate across the web and the enterprise. WCF clearly demarcates development and implementation. There are various Hosting options available and is independent of the run-time environment in which the service is deployed, they are:-
  • Self-Hosting in a Managed Application
  • Managed Windows Services
  • Internet Information Services (IIS)
  • Windows Process Activation Service (WAS)
All the development part lies in the code while the implementation like the binding can be handled in the config file as Microsoft has abstracted a lot of plumbing work reducing the implementation time. By this way developer can concentrate on core logic and WCF takes care of data delivery in the most reliable, secure and high performance fashion depending on situation.

WCF has an integrated Logging mechanism that helps you log traces. In other technologies developer has to write custom solution but in WCF, all that you need to do is to enable trace by changing the config file.

To achieve security mechanism in WCF you have 3 implementation choices:

  1. Transport: Transport security depends on the mechanism that the binding you've selected uses.
  2. Message: Message security means that every message includes the necessary headers and data to keep the message secure.
  3. TransportWithMessageCredential : This choice uses the transport layer to secure the message transfer, while every message includes the rich credentials other services need.
After the launch of modeling edition I feel it gets easy to delegate work in a team. An architect can create a Data Contracts/Relationships, Message Contracts and Service Contracts. After that only the facade layer has to be made with some tweaks here 'n' there. In this way lot of architecture intricacies can be hidden from developer.

WCF does not replace MSMQ, COM+ or Web Services, it provides a declarative infrastructure for all forms of communication to and from the Windows platform. Using WCF, communications happen at designated service endpoints, and an endpoint can implement different protocols (such as Web Service, WS-* SOAP style services), encodings (such as Text, Binary & MTOM), and transports (such as MSMQ, Http, etc.).

With .net 3.5, it becomes even easier to provide RESTful endpoints (JSON, POX, RSS and ATOM). So the real powerful leverage shall be building services that can be consumed by a ASP.net web client as JSON while simultaneously being accessed by a business partner through a php web client using the SOAP protocol (with its full complement of WS-* implementations such as WS-Security, WS-ReliableMessaging, etc.)

No comments: