Wednesday, January 25, 2012

Patterns for Flexible WCF Services

Patterns for Flexible WCF Services


While SOA promotes loose coupling at the transport layer and also facilitates platform independence between consumers and the services they interact with, we are still coupled to the interface as defined by the service’s contract. We’ve learned a lot about how to create loosely coupled systems over the last few decades, but how can we apply those lessons to services? This article expands upon Martin Fowler’s
Service Layer Pattern. It presents patterns that allow you to define descriptive, maintainable, yet extensible contracts specifically with Microsoft’s WCF technology.



When Flexibility in Service Contracts Goes Awry

One of the central themes in Service-Orientation (SO) is the idea of the contract. While this concept is not new (e.g. COM components developed in C++ described their contracts with Interface Definition Language, while the VB IDE hid the contract from developers), the way we document that contract is quite different when we use Service-Oriented principles. Most people probably know by now that web services, the most common way to implement the Service-Oriented style of design, uses XSD and WSDL to define these contracts.  One of the most interesting developments that I've seen is how people are viewing these contracts. Most people, for obvious reasons, seems to prefer contracts that are explicit and self-describing. Many people, even those who espouse the "Contract First" concept, also want contracts that can be unilaterally altered in some way. The hope is that none of the consuming applications will break when these changes are introduced "under the radar". Recently, when considering all of this, I found myself reflecting upon what I learned about contracts in the few law classes I took back in my college days a long long time ago.


0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home