Windows Communication Foundation: Time for Services
Published: January 5, 2005
By Andrew Filev, VP, Murano Software
Microsoft Certified Architect
A lot of people are talking and blogging about the Service Oriented approach to building applications. Many more people are still building applications using different architecture styles. This note is addressed to developers and architects who have postponed their migration to services territory, and are still waiting for a mature software development platform. With the forthcoming Windows Communication Foundation (WCF) release, many more people will be able to leverage the benefits of service orientation, and greatly reduce their stress levels when adopting this approach. WCF (formerly code-named "Indigo") is unified, interoperable, extensible and packed with features. It allows for the creation of secure, reliable and transacted services.
SOAP-based web services, in the form they were introduced in 2000, had a big problem: They were too simple and raw. In order to get interoperability, developers had to limit them or effectively reinvent the wheel by writing their own support for transactions/reliable delivery/etc. Web-service enhancements like WS-Security and WS-ReliableMessaging, introduced later, solved a lot of problems, but the difference in convenience between using "enhanced" web services and proprietary distributed development techniques were at least noticeable. Windows Communication Foundation closes this gap and provides a solution that is elegant and powerful at the same time.
Another gap bridged by Communication Foundation is the difference between the ASMX, Remoting, Enterprise Services, WSE and MSMQ programming interfaces. With WCF, developers get one programming model for building connected applications that use different protocols and system-level features. Communication Foundation provides the right balance between making the service orientation explicit and implementation details implicit. This combination makes Indigo natural choice for building services' façades in distributed applications. With transactions and security support enterprises got the right tool to build applications, which will communicate to each other. But enterprise software developers are not the only ones, who will benefit from Windows Communication Foundation.
When web services or service oriented architecture is mentioned, enterprise applications integration or B2B scenarios usually come to mind. WCF goes further and introduces support for peer-to-peer applications. P2P applications became a hot topic after publicity from file sharing, and Skype reinforced attention here recently. But there are still plenty of opportunities. Social software and services are as hot in working teams as in the student community. P2P is the right choice for a lot of casual or dynamic groups that have no intention of installing servers. Windows Vista, along with the Communication Foundation platform, includes Peer Name Resolution Protocol, People Near Me, Grouping and Peer Channel. Take a look at the nice piece of code in PeerChannel Chat sample in Windows SDK.
One of the key characteristics of platform design is the ability to provide a consistent approach for solving different problems. An impressive feature of Indigo is how easily it can be applied both to the world of interoperable web-services enterprise systems and peer to peer software for casual users. Windows Communication Foundation is built on simple concepts, hiding complexities in system-level code. Those concepts are:
- Contract, specifying what you may send to the service and what you may receive. WCF recognizes service contracts, data contracts and message contracts. These concepts have corresponding attributes to annotate façade classes and interfaces in C# and VB.NET.
- Binding, telling how you may communicate with the service. Bindings are specifications of the channel stack, varying from the bottom of transport protocol up to security schemes. Bindings may be configured. They also might be extended and customized.
- Address, allowing you to find the service and distinguish it from other services.
Services expose Endpoints, consisting of Address, Binding and Contract, to the world.
The internals of service life are configured using the ServiceBehavior and OperationBehavior attributes. These behaviors include support for instancing, concurrency, transactions and other useful features, the lack of which prevented web services v1 from being adopted more widely. Those aspects are easily configurable in a declarative way.
This note gives a broad overview of Windows Communication Foundation. The rich features and ease of use that WCF brings to the job of developing service oriented applications make it a must-know technology for any enterprise software architect in the Windows world.
|
|