Main Reasons of Creating WCF - cSharp Coder

Latest

cSharp Coder

Sharp Future

Wednesday, August 12, 2020

Main Reasons of Creating WCF

 Modern Application[Distributed Application] development we use different architechtures and technologies for communication

i.e:
·         COM+
·         .NET Enterprise Services
·         MSMQ
·         .NET Remoting
·         Web Services
As there are various technologies. they all have different architechtures. so learning all them are tricky and tedious.
one need to focus on each technologies to develop rather than the application business logic
so microsoft unifies the capabilities into single, common, general service oriented programming model for Communication. WCF provides a common approach using a common API which developers can focus on their application rather than on communication protocol.
Now-a-days we call it WCF.
What Exactly WCF Service Stands For?
WCF lets you asynchronus messages transform one service endpoint to another.
The Message Can be simple as
·         A Single Character
·         A word
sent as XML
·         complex data structure as a stream of binary data
Windows Communication Foundation(WCF) supports multiple language & platforms. 
WCF Provides you a runtime environment for your services enabling you to expose CLR types as Services and to consume other Services as CLR Types.
A few sample scenarios include:
·         A secure service to process business transactions.
·         A service that supplies current data to others, such as a traffic report or other monitoring service.
·         A chat service that allows two people to communicate or exchange data in real time.
·         A dashboard application that polls one or more services for data and presents it in a logical presentation.
·         Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
·         A Silverlight application to poll a service for the latest data feeds.
 
Why on Earth We Should Use WCF?
·         from a Code Project Article, thanks to @Mehta Priya I found the following Scenarios to illustrate the concept. Let us consider two Scenario:
·         The first client is using java App to interact with our Service. So for interoperability this client wants the messages in XML format and the Protocol to be HTTP.
·         The Second client uses .NET so far better performance this clients wants messages in binary format and the protocol to be TCP.
Without WCF Services
now for the stated scenarios if we don't use WCF then what will happen let's see with the following images:
·         Scenario 1 :

·         Scenario 2:

These are two different technologies and have completely differently programming models. So the developers have to learn different technologies. so to unify & bring all technologies under one roof. Microsoft has come with a new programming model called WCF.
How WCF Make things easy ?
one implement a service and he/she can configure as many end points as it required to support all the client needs. To support the above 2 client requirements -we would configure 2 end points -we can specify the protocols and message formats that we want to use in the end point of configuration

No comments:

Post a Comment