Extended WCF– Preview…

Posted on December 19, 2010 by

0


WCF can be extended through the extensibility points (see  http://wcfpro.wordpress.com/wcf-extensions/), but sometimes these points are not good enough.

In the next posts under this category, I’m going to describe a way to extend WCF on the client side which does not use the extensibility points and by this allowing us to implement more advanced features.

In our products, all our communication clients needed the same communication logic, such as:

  1. Retry mechanisms (which the client is unaware of)
  2. Advanced routers/load balancers mechanism
  3. Channel lifetime management

Instead of implementing this over and over again in each client, we have decided to implement it once in a common place,and by that leaving our users to concentrate on writing just their applications logic. Since all of these requirements involve more than one channel (for example, load balancing between more than one channel/element) we had to create a wrapper layer on top of WCF (which we called ECF – Extended communication framework).

Our wrapping layer exposed a simplified API, hiding all the communication complexity from the users. This API  returned the client a custom proxy (which implemented the WCF contract) and redirected each call to go through out internal logic before moving on to WCF.

There are several ways to create such a custom proxy, for example, one can use the

System.Runtime.Remoting.Proxies.RealProxy

(as used by WCF itself), and insert the logic under the Invoke() method. We had several reasons not to use this option, which I might cover in future posts. Our selected approach was to generate a custom proxy at runtime which gave us additional flexibility for more advanced features (this will also be covered in future posts).

About these ads
Posted in: Extended WCF