Sunday , 23 April 2017

WCF : Defination, Need And Advantages

WCF Stands for Windows Communication Foundation. It is a part of .Net Framework. WCF is Microsoft’s platform for developing distributed and interoperable applications.

What is Distributed Application?

Distributed application are those application where parts of the application is running on two or more computer workstations whether  they are physically located on the same location or two more different locations. This type of applications is also called connected systems.
For example, a web application running on one machine is consuming a web service that is running on a different machine. So this is a connected system.

Connected System

Needs of Distributed Applications

  1. If an application wants to consume services provided by another service, then we have to develop a distributed application.
  2. For better performance and scalability: An application may have divided into parts. Each part has a heavy load on it. If we will run this application on a single machine, then the performance of the application will be degraded. To improve the performance we have provide new hardware and other required resources. This is not a perfect solution of the problem.

To solve this problem we can run the parts of the application on the different machines. Thus the load of the application will divided between different machines. This will improve the performance of the application.

What is an interoperable application?

An application which can communicate with any other application that is built on any platform is called an interoperable application.

Web services are interoperable, whereas .Net remoting services are not. Web services can communicate with any application built on any platform. On the other hand .Net remoting service can communicate only with other .Net application.

Technologies before WCF to build distributed applications.

  1. Enterprise Services
  2. .Net Remoting Services
  3. Web Services

Why to use WCF?

Suppose we have two clients. And we are developing a web service to serve both the clients.

The first client is using Java Application to interact with our web service. For interoperability he needs messages to be in XML format and the protocol should be HTTP.

We can satisfy this client without WCF. We can implement a ASMX web service to satisfy this client.
Web Service

The Second client uses .Net Window Application, for better performance he needs message format in binary and the protocol is TCP.

To satisfy this client we have to implement a .Net remoting service.

Remoting Service

Conclusion

Web services and remoting are two different technologies. So the developer has to learn two different technologies.

Thus, to bring all these communication technologies under one roof Microsoft introduced a single programming model that is called as Windows Communication Foundation – WCF.

By using WCF we can implement one service and can configure as many end points as want to satisfy all client needs.

Two satisfy these two clients in above example, we will configure two end points. In the end points we can specify the protocol and the format of the message.

WCF Service

If we would have a third client with different protocol and message format, we had to configure a third end point to satisfy him.

So, we can satisfy all our clients with one service. Developer do not have need to learn different technologies.

Like dotnetkey.com on Facebook to get yourself updated towards latest tutorial on .Net.

Leave a Reply