WCF Part 1: Why WCF?

WCF
WCF @Image courtesy of ddpavumba/ FreeDigitalPhotos.net

WCF Part 1: Why WCF?

Welcome to CodeSpread!

When i create a WCF service, i feel like it is a very easy task but when somebody asks me, why you have created it? then the simplest answer is, i got the requirement like this. But to be honest, Nobody tells us to use WCF specifically. Then why there is roar over WCF? This post will touch the ‘why’ perspective of WCF and in subsequent articles, we will touch base with WCF through coding or programming.

What’s the idea behind WCF?

Idea behind , can be described as simplified communication between applications or programs written in different languages or residing at different locations.

We will try to see two important concepts which are required to understand as How communication between components can be a possibility?

Note: Here, component refers to a program or functionality which can exist independently.

  1. Remote Procedure Calls (RPC) :

    As per Wikipedia “a remote procedure call (RPC) is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction” .

    In Simple words, We have two machines, Server and Client, there is an independent code/program/component available or placed on Server to perform some function. Client like our remote machine is also running a code/program/component, which sends a request to Server to execute program residing on server machine and once execution is over,Server should share the result with program on Client machine who have waited for Server to finish the job.

  2. Interfaces:

    Now we have some idea about RPC, here, we can deduce that Server has to tell the client which all methods are available for use. Now, There is a catch, Server should not expose their methods directly, There should be a level of encapsulation and abstraction applied to protect the functionality. We have interfaces to achieve this kind of feature.

    Interface ICalls()
    {
    public void GetCount();
    }
    

    An Interface defines the expected behavior and it is available when Server side component implements this interface by inheritance.This interface can only exist if the component is instantiated. This interface is exposed to the client and, As it hides all the complexities of implementation, client just needs to call the method exposed through interface.

    RPC Calls:

                    Client => Interface=>Server

All the service oriented technologies like COM,DCOM,Remoting, WebService,WCF were developed on this Model  and can be described as improvised versions of RPC calls via interface. We will try to see the improvements achieved by each of these technologies.

1.COM:

Component Object Model- COM can be considered as the birth of communication between the components. In this Model, two independent component interact with each other trough interface pointers like IUnknown.There is no server and client approach established with COM but components developed on different platforms followed binary standard for function calling between components.Here, the point of interest is communication happens between the components residing at the same location.

2.DCOM:

Distributed Component Object Model- As COM was not efficient in communication between components residing on remote locations, DCOM came into existence. Wiki has mentioned “The addition of the “D” to COM was due to extensive use of DCE/RPC (Distributed Computing Environment/Remote Procedure Calls)”. DCOM was Microsoft’s version of handling calls between remote components. DCOM was one of the first attempt of distributed environment where client components can request services from server components on other computers in a network.

3.Remoting:

DCOM was an improvement over COM but it didn’t achieve a global distribution adaptation so Microsoft came out with .Net Remoting. .NET Remoting helped in improving inter-process communication by providing loose coupling between remote object and client, also made the communication independent of specific formatting. As a result, it was easy to replace one communication protocol with another, or one serialization format with another without recompiling the client or the server.Remoting was able to use Http or TCP, and messages could have been formatted as Binary or Soap.

4.Web Services:

Though Remoting was considered more useful but there were some grey areas and web services took care of that.

  • Web Services are Interoperable with many software vendors, languages and platforms and not limited to .Net like remoting.
  • Audience is Unlimited and available to World Wide Web.
  • Easy Development,Deployment and Maintenance.
  • Highly scalable.
  • Follows open web standards (such as SOAP, HTTP, and XML)

With all the above information, we have passed the journey of communication between components and reached the latest edition of communication, WCF.

How can we say, it is an improvement?

Till WCF came into picture, every technology was an improvement over the previous one but WCF was one complete product, created and built from the ground up. It can termed as a unified platform having all the improvisations achieved earlier by COM,DCOM,Remoting, WebService.  We can compare it with immediate predecessor .

  • Web services technology uses open web standards and build applications that send and receive messages via the Simple Object Access Protocol (SOAP) over HTTP. The  messages sent or receive were defined using XML Schema. Same with WCF.
  • There were only singlex and request-response communication possible in WebServices. WCF have singlex, request-response, full duplex communication.
  • Web Services supported only HTTP whereas WCF supported more like TCP, IPC, MSMQ.

We can say at this point, why we require WCF compare to other options. In 2nd article, we will describe WCF and its implementation. WCF Part 2: Fundamentals

Author: hershey

A passion for knowledge drives me to do programming, A passion for programming drives me to create something different, A passion for creation drives me to spread the knowledge.

Share This Post On

5 Comments

  1. nice superb explaination

    Post a Reply
  2. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

More from CodeSpread:

  • WCF Part 2: Fundamentals.WCF Part 2: Fundamentals.We have seen the evolution of WCF in our previous article: WCF Part 1: Why WCF?. Next, we will go through the fundamentals of WCF. I will try to make it more worthy than an interview question puff....
  • Difference Between Transport and Message Security in WCFDifference Between Transport and Message Security in WCFTransport Security in WCF As the name suggests, it is concerned with security of communication between client and the service over a network protocol. It guarantees the confidentiality and integri...
  • REST- REpresentational State TransferREST- REpresentational State TransferREST – REpresentational State Transfer, is an enhanced version of client server style architecture for distributed communication. When we talk about distributed communication, we think of reques...
  • WCF Part 3: Direct from WCF kitchen.WCF Part 3: Direct from WCF kitchen.In the last two articles WCF:Part 1 and WCF Part 2, we have covered basic knowledge and terminologies of WCF.Now we will apply that knowledge to create a WCF service.There are lot of articles avail...
  • Few lines about WCF metadataFew lines about WCF metadataWhat is WCF metadata? WCF generates metadata for service endpoints and this metadata is used to describe how to interact with the service's endpoints. This information is used by Svcutil.exe to ge...
  • Caching in WCF ServicesCaching in WCF ServicesYes, It is possible and clearly a  significant performance enhancement. How caching works for WCF services? Lets assume, a user sends a request to a service so at server, service method is called...
  • 23 Dec: Must Read Codes [11-15]23 Dec: Must Read Codes [11-15]We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeRe...
  • Few lines about Static code analysisFew lines about Static code analysisStatic code analysis We divide the term into two parts: Static+code analysis. Static in programming can be referred to as non-running/non-dynamic and code analysis is a process where the code is...