I've been playing with Windows Communication Foundation for a while now, and one of the really strong points of WCF is it's extensibility story. While certainly not perfect, there are a lot of points where you can hook into the processing pipeline and introduce custom code into almost all aspects of the request processing and metadata generation models.
There are some great resources on the extensiblity points that I've seen around:
- Steve Eichert on WCF Extensbility: Behaviors and Inspectors.
- Christian Weyer on WCF Extensibility Cornucopia.
- Ralph Squillace on ExtensibilityWriter sample.
- Drew Marsh on Providing Custom Context for WCF Services.
- Aaron Skonnard on Bindings vs. Behaviors.
- The WCF Extensibility Samples in the Windows SDK.
I'm sure there are many more that I'm missing!
A few days ago, I posted about the WsdlNoticeBehavior I implemented as a custom IWsdlExportExtension, and now I've been playing with a different set of extensibility points. Here's a bit of sample code as to what it looks like:
[ServiceContract]
public interface IVoucherService
{
[OperationContract]
Voucher Buy(VoucherRequest request);
}
public class VoucherService : IVoucherService
{
[InstrumentedOperation("VoucherService")]
public Voucher Buy(VoucherRequest request)
{
// ...
}
}
And here's the result of this:
There are a lot of pretty cool things you can do with the extensibility points in WCF, and I definitely expect to spend some more time going over them and experimenting with what you can do. Hopefully, we can get some cool reusable extensions out of this that other people can take advantage of (hey, that might even be a cool idea for an OSS project, if anyone else is interested).
Technorati: WCF, Windows Communication Foundation, WCF Extensibility