InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

The new WCF Web Programming Model supports REST Design

Posted by Hartmut Wilms on May 16, 2007

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
SOA ,
REST ,
.NET ,
Web Services
Tags
Orcas ,
WCF

Don Box and Steve Maine introduce the WCF Web Programming Model to be released with Visual Studio Orcas in their talk "Navigating the Programmable Web" at MIX07. The Web Programming Model features support a RESTful design of web services within the unified WCF programming model.

The new features are intended to help programming simple services that do without a SOAP envelope or any WS-Specs. Instead the Web Programming Model centers on URIs and the HTTP verbs. In order to maintain the WCF programming model, the ServiceContract, DataContract and all other Service Model aspects of WCF are still used. The new model manifests itself mainly in a new WCF Service Host, called WebServiceHost, and a new standard binding: WebHttpBinding. The new features consist of:

  • Support for URI templates by the System.UriTemplate. A URITemplate is used to defined a specific pattern of URIs. The idea of URI templates is described by Joe Gregorio in his blog entry.
  • System.UriTemplateTable, which is used for storing a set of UriTemplates that can be matched against a concrete URI in order to find the best match.
  • [WebGet] and [WebInvoke] attributes for service operations, which are used by the WCF dispatcher in order to map an HTTP request to an implementation method.
  • WebServiceHost and WebHttpBinding.
  • System.ServiceModel.Syndication namespace, which adds support for producing and consuming RSS/Atom feeds.

All features are explained in detail in Steve Maine's series on the Web Programming Model: Zen of the Web Programming Model (Part 1), Zen of the Web Programming Model (Part 2), Zen of the Web Programming Model (Part 3), UriTemplate 101, and UriTemplate.Match.

According to Jef Newsom Don Box's and Steve Maine's talk represents the catharsis of Microsoft's approach to distributed computing in Some Interesting History:

So, it is interesting to me to watch guys like Clemens Vasters and Don Box (and Steve Maine, though I think he was less heavily involved in 'expectorating' the WS-splat and a lot more heavily involved in consuming and evangelizing prior to getting into the big house) starting to shed the WS-Splat baggage and just GET it. And I think that they are being pragmatic about it and trying to scratch the 80% itch (GET) really well, but they are adding in a decent set of support for the REST (ha, pun, ha ha, er, um...) of the story without being to religious about being RESTful. And when questions come up like [paraphrased] "Well, shouldn't you layer soap into that?" they look very relaxed and calm as they say [paraphrased] "Nah, you're not going to need it here." From the outside, it looks a little cathartic.

He already made his first baby steps and writes about his experiences in the first and the second round of his wrestling with the Web Programming Model.

David Ing calls the talk the Simple Object Apology Protocol, because "after all that work and code put into SOAP based infrastructure and programming models, [the Web Programming Model] is essentially a 'roll-back' of the application protocol stack back to around 2002.". He also points out some risks of adding a new model to the WCF stack:

One big problem with the 'add an alternative layer, now we know' approach is that many developers equate the latest technology update to mean the latest guidance on what to use for their problem. [...] By having such a broad choice of what to use (REST, HTTP/POX, SOAP, Remoting etc. etc.) then for the people looking for the 'one simple answer' it just gets increasingly complex and confusing. The complexity tax of these news things are start to look like the federal deficit - always going the wrong way.

Steve Maine responds to these two reactions by stating that WCF is essentially "Balancing reach and rich":

As such, I think the reach programming model work we're doing now actually increases the value of the rich protocol stack in V1 because it gets rid of the traditional scenario cliff between rich and reach. Take a framework like Rails, for instance - which is optimized around making a common set of scenarios very easy. Granted, the stuff Rails optimizes for hits the 80% case. But if you suddenly have to step into the other 20% for whatever reason, you're kind of screwed (as the Twitter guys are finding out). We want to protect folks who take a bet on WCF from falling off similar cliffs in the distributed systems space. We're taking a big step in that direction with the Orcas Web features, and you can expect us to continue down that road over time.

The Web Programming Model is another step of consolidating the programming models of all known protocols and ways of developing distributed applications within WCF. It is also one of many signs that Microsoft is really fond of the REST way and incorporates REST designs in their project portfolio today: The Astoria Project is already based on the new model.

  • This article is part of a featured topic series on SOA

No comments

Watch Thread Reply

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.