WCF Se Maine Pyar Kiya Tak :)

Today, we’re going to understand a new concept and for that matter, you must be familiar to Bollywood and movies like ‘Maine Pyar Kiya’ (MPK). You can say this as a pre-requisite.

In MPK, there was a situation, where hero and heroine were separated a distance apart. Then heroine used to send ‘Love Letters’ using pigeon postal service. And she used to sing a song for that matter – ‘Kabootar Ja Ja Ja

Untitled-1

Now, Windows Communication Foundation (WCF) is a unified programming model to build distributed applications. In our scenario, Sallu is providing his ‘best love’ services (pyar, daulat, shoharat, etc…) and Bhyagyashree is going to consume those.

Here hero and heroine are at two distant places and we call it as end-points. And, if they want to communicate, they must have ABCs i.e.

  1. A for Address on which she will send a letter, look at Sallu’s address
  2. B for Binding which defines how they communicate – here ‘OnAirBinding’ or Pigeon is used
  3. C for contract, the contract between Sallu and Bhagyashree says, if Bhagyashree wants Sallu to bestow all romantic poems, letters on her, she must send a love letter to him, kind of.

This scenario depicts the basic peer-to-peer communication in WCF (oops Bollywood movies). Here, in this mode of communication Salman is service provider and Bhagyashree is consumer, but sometimes situation can be other way round. And it’s very much possible.

image

In this new picture, what do you understand?

Well, WCF is not just about peer-to-peer applications. But can be used in many different applications as well. In this case Salman is a service provider (or publisher) and Aish, Kat and Bhyagyashree are service consumers (or subscribers). They are registered with Salman for his ‘best’ services.

But to provide these services, everyone needs to have ABCs.

  1. A – Address. Everyone will have a unique address for communication purpose
  2. B – Binding. Everyone will have their own mode of communication. In previous case it was Pigeon service, now it’s Email, Phone, Mobile and what not. WCF provides bindings like Http, TCP/IP, etc…
  3. C – Contract. All these actresses will have their own terms and conditions to work with Salman. And these terms and conditions will be put into contracts.

The main advantage of WCF is – it can communicate with any other technology. That means, WCF can communicate with .NET Managed based applications, Native applications, J2EE based applications.

To consume WCF services, client creates a proxy object of the service (mostly called as ‘ServiceClient’). In our scenario, all the gals will be having their own ‘personal copy’ of Salman Khan; however, original Salman is totally different. It’s like Salman will be having clones to enjoy himself with his girlfriends. Remember Dev Anand in ‘Teen Devian’? Nice idea, if we could implement in our world.

Probably, I’ll share some technical examples in next few posts. But, after this, you can see the how WCF works.

Enjoy.

Namaste

Mayur Tendulkar | www.mayurtendulkar.com

Published by

Mayur Tendulkar

Struggling Juggler

5 thoughts on “WCF Se Maine Pyar Kiya Tak :)”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.