In this article we are going to see an introduction to Windows Communication
Foundation.
WCF is a unified programming model for building service oriented distributed
applications .
Lets go down the History of Distributed applications . The Monolithic
applications gave way to applications built with components using COM (
Component Object Model ) . Monolithic applications would mean where everything
exists with a single exe or a application . Using COM you could create
components which would do particular tasks and COM would make these applications
available to you .
This was good for the Desktop applications . But what about the Web world . So
Desktop COM make way for Distributed COM .
So now COM components could be hosted on the Server and your application could
access this COM components .
DCOM further evolved into COM+ and intergrated with the Transaction Server . So
all your datalogic and Business log would now run on a Central Server and you
could now have transactions supported as well.
And then came .NET , and rather than completely rewrite the Business Logic .
The .Net components can now use Enterprise Services to Leverage COM+.
Another option to build distributed applications was Remoting. .NET Remoting
consists of a client and remote objects hosted on a server .
Client can access remote objects as if they are local .
Enterprise Services and .NET Remoting require client , components and data to be
on the same network . But what happends when that is not the case . What happens
when you client and data to be accessed by the Client are not in the same
netwrok .
Web Services Solves this problem . Web Services enable you to pass data as XML
over Internet .
Now the Client and Server to pass the XML back and forth both Client and Server
need to agree upon how the xml looks like . That's where SOAP comes in .
Simple Object Access Protocol defines structure of XML messages clients and
services pass .
Visual Studio helps us create and comsume Web Services easily without much trouble . So this approach of Building Distributed applications is called
Service orientation .
A Service is a program that performs a task and that you can interact with
through well defined messages .
In other words we can say that a Service Oriented application consists of
loosely coupled services that communicate through messages and contracts.
Messages are the actual messages that go back and forth and contracts are
basically the interfaces that define what the service will do .
They are Loosely coupled because the Client does not instantiate the Service .
So this is a major difference between a Service oriented architecture or say a
COM component model where the Client would have to instantiate the Server Class
.
In the Service Oriented Architecture the Client does not instantiate the Service
, instead it just passes the method .
So there is a Shift from remotely invoking components to passing messages
between services .
Principles of Service Orientation :
Join the conversation! Your thoughts help the community grow.