Tuesday, December 18, 2007

Architecture of Windows communication foundation

Architecture at glance
Here I am talking about the Architecture of WCF in brief.
Architecture of Windows Communication Foundation consists of five layers. These layers from top to down are:
· Application: In this level application is located.
· Contracts: This is the contract layer which is all about the contract between service and clients.In this layer service, data and message contracts and policies are present. In this level services describe themselves to clients.
· Runtime: Behaviors are located in this layer. It is basically used to load all the services.
· Messaging: Different types of channels as well as encoders are here. This layer enables communications channel for services and clients. That means you can define the communication channel for services over here.
· Host: This layer is where host services in different manners, but there are two common ways to host a service.
You can host a service in Internet Information Services (IIS) which is easier than the second approach and which you usually do for any other service. It starts and stops your services automatically.
The second approach is to create executable files (.EXE) for services and start and stop them manually by writing more codes.
This layering allows developers to work on Windows Communication Foundation with different skills because each layer needs different skills.

Programming Approaches
Windows Communication Foundation has simple and easy to write/understand codes. It has many APIs, but beside this only a small amount of these API's is common.
There are three programming approaches in Windows Communication Foundation:
· Imperative: You use programming codes in different languages to accomplish a task. That means you can use different Programming languages.
· Configuration Based: You use configuration files to do things.
· Declarative: You use attributes to declare something.
You can use all this approaches to build the complete application in WCF.
In general, you will declare contracts and behaviors using attributes, configure endpoints, security and some other settings in configuration files and will implement service methods logic in codes using different programming languages.

You can work with the two types of services here:
1) Typed services
2) Untyped services.
In typed services you pass normal objects and data types and/or get normal objects and data types, but in untyped services you pass and get messages to work directly with messages at a lower level.

Thursday, December 6, 2007

Basics of Windows Communication Foundation

Windows Communication foundation is one of the four major features introduced in the Microsoft .Net 3.0 freamework.

Windows Communication Foundation (formerly code-named "Indigo") is a set of .NET technologies for building and running connected systems. It is a new breed of communications infrastructure built around the Web services architecture.
Let us see what all enhancements are made by Microsoft in this coming version:

Windows Communication Foundation has some important enhancements in comparison with preceding technologies.
· It merges all older separate technologies in one place and allows you to do things easier.
· It has rich communication capabilities.
· It comes with many powerful and ready to use enterprise features.
· It can be integrated with other technologies and has great interoperability.

Fundamental Concept

In Windows Communication Foundation your services can have communication with clients by sending and receiving messages.

Windows Communication Foundation consists of three main concepts:
· Services: Programs that respond to clients. They can send or receive messages.
· Clients: Programs that ask for a service. They can send or receive messages.
· Intermediaries: Programs that sit between services and clients. They can work as a firewall or can rout messages. In all cases neither services nor clients need to be aware of intermediaries.

Most of the time, developers deal with services and clients and do not need to work much with intermediaries.
Services and clients have communications by sending and receiving messages, but again most of the time you do not work directly with messages and Windows Communication Foundation does this for you.

Here you should learn that a service can have more than one client and each service can be a client of another service itself.

Each of these main concepts has important concepts in its core or beside it. Some other concepts that you will deal with frequently are Channels, Bindings, Contracts, Behaviors, Addresses and Endpoints.