What is WCF?
- WCF stands for Windows communication Foundation.
- It is a Microsoft platform for building distributed and Interoperable applications.
- It is a framework for building service oriented applications
What is a distributed application?
- Distributed application is an application where parts of it run on more than one computer nodes.
- A web application running in one machine and consumes webservice from different machine.
- An enterprise application has following tiers.
- Presentation Tier
- Business Tier
- Data Access Tier
- You can have each tier in different machine to improve scalability of application.It would help taking more request without impacting application performance.
Why to build distributed application?
An enterprise application may need to use the services provided by other enterprises.
Ex: The product websites integrated to payment gateways
For better scalability
An application can have presentation layer,business layer and data access layer and eaach layer may be running on different machine
What is an Interoperable application?
- An application that can communicate with any other application that is built on any platform as an interoperable application.
- Web services are interoperable. Web services can communicate with any application built on any platform.Also it uses XML and HTTP and any platform can understand HTTP and XML.
- Before WCF, we had multiple options to build distributed applications.
- Enterprise services
- Dotnet Remoting services
- Web Services
Why to use WCF?
For an example we have 2 clients. The first client is using a Java application to interact with our service, so the clients wants messages to be in XML and the protocol to be HTTP.
So without WCF, we will create a asmx service and it supports both HTTP and XML messaging to suffice the client requirement.
Reference books, you may like:Programming WCF Services: Design and Build Maintainable Service-Oriented Systems
WCF Multi-Layer Services Development with Entity Framework, 4th Edition
Learning WCF: A Hands-on Guide
Whereas the second client wants us to send binary message and TCP protocol. To suffice the requirement we will end up writing remoting services.
Remoting service has a different programming model, so we want our developers to learn remoting services to suffice the client requirement.
So for both client we will end up creating 2 services.web service and remoting service. This is the reason, Microsoft came up with WCF to unify remoting, enterprise services ,webservices etc.
In WCF, we can create one common WCF service and expose multiple endpoints to suffice different message format and protocols for the clients.
In the configuration file, we can define the protocols and message format for the clients.
© 2015, admin. All rights reserved.