WCF Examples


WCF Projects

WCF Project

Introduction of WCF

The Windows Presentation Foundation is Microsofts next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher.WCF (Window Communication Foundation) is a solution for developers to work in distributing environment. WCF create communication between applications. Before WCF, the technologies to make communication between applications were ASMX, .NET remoting, and COM+. WCF provides a common platform for all .NET communication, different technology combined to form WCF.

WCF is a framework that is used for developing, configuring, exposing, and hosting services. All service providers were agree on SOAP concept for making communication between application before WCF. The idea of WCF is a combination of SOAP and web service.

There are two categories of classes in WCF

  1. Service model classes handle configuration and validation.
  2. Channel layer classes handle things such as communication and data transformation.

WCF services expose functionality through one or more endpoints. Clients communicate with the service's endpoint. In configuring an end points there are three components require.

  1. Address
  2. Binding
  3. Contract
WPF Architecture

WPF is actually a set of assemblies that build up the entire framework. These assemblies can be categorized as

  1. Managed Layer
  2. UnManaged Layer
  3. Core API
Managed Layer

Managed layer is a collection of number of assemblies. These assemblies create the WPF framework, communicates with lower level unmanaged API to render its content. The few assemblies that comprise the WPF framework are

  1. PresentationFramework.dll : It is used to Creates the top level elements like layout panels, controls, windows, styles etc.
  2. PresentationCore.dll- it is used to holds base types such as UIElement, Visual from which all shapes and controls are Derived in PresentationFramework.dll.
  3. WindowsBase.dll- It is used to hold even more basic elements which are capable to be used outside the WPF environment like Dispatcher object, DependencyObjects. I will discuss each of them later.

Unmanaged Layer (milcore.dll)

The unmanaged layer of WPF is called milcore or Media Integration Library Core. It used to translate the WPF higher level objects like layout panels, buttons, animation etc into textures that Direct3D expects. It is the main rendering engine of WPF.

Core API

This is low level API which is used for imaging support in WPF applications.

WindowsCodecs.dll comprises of a number of codecs which encodes / decodes images into vector graphics that would be rendered into WPF screen.

Features in WCF
  1. Dynamic Service and End Point discovery
  2. Intermediate Routing Pattern ( Generic Routing Services)
  3. Discovery announcement
  4. Simplified Configuration
  5. Protocol bridging and Fault tolerance
  6. Standard End Points.
  7. svc-less activation of REST services or making REST URI nice.
  1. Its made of a lot of different components, so you can create new components for security, transport, authentication
  2. In WCF, there is no need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.
  3. Its faster than ASMX
  4. Supports Scaling/Load Balancing
  5. WCF has integrated logging mechanism, changing the configuration file settings will provide this functionality. In other technology developer has to write the code.
  6. Its Interoperability, for java, and more.
  7. WCF is interoperable with other services when compared to .Net Remoting,where the client and service have to be .Net
  8. WCF services provide better reliability and security in compared to ASMX web services.

A drawback would be that, WCF is Microsoft's implementation of SOA and hence its APIs are solely controlled by MS which makes interoperability a bit difficult.

Also, to deploy WCF apps, you will need more underlying hardware resources on the platform on which the WCF applications will be running, since there is an additional layer of abstraction to deal with.