Friday, May 20, 2011

MIX 2011 Presentations Reviews

Glenn Block's presentation on WCF and URIs is very good from MIX 2011. Mike Simpson also forwarded me a recent DotNetRocks episode in which Block discusses the WCF HTTP WebAPI.

MIX 2011 presentation: "There's a URI for That":
DNR episode: "Glenn Block Simplifies WCF with WebAPI":

In the MIX 2011 presentation, some highlights of things he demonstrates the following:
  • Microsoft is committed to delivering a first-class HTTP programming model for WCF
  • The HttpWebResponse<OfTypeT> response type, which has full support of HTTP status codes, demonstarted with response.StatusCode = HttpStatusCode.Created to indicate a successful "resource created" response status from the server to the client.
  • The use of media types and registering X number of media type processors to handle incoming requests based on "extensions" supplied on the URI.
    • Gone are the days when an extension like ".aspx" or ".txt" were tightly-coupled to the file-system and to physical files on disk. Instead, these are now fully interceptable and processable by YOUR handler code in the way YOU WANT.
  • Using an OData producer resource, he showed Google's GMail contacts import dialog pulling down contacts from his WCF service in vCard format, as specified by an extension, and an OData filter expression that limited the results returned to the top 3 results
All in all, I am feeling increasinly confident that Microsoft's direction regarding HTTP and REST is moving in a solid path. While it is of course possible to build REST/HTTP style Web APIs without WCF and without explicit support from Microsoft, the fact that Microsoft is supporting this provides two advantages:
  1. It increases the mind-share and desire amongst .NET developers to understand the web and to leverage these technologies,
  2. It provides an easier path toward enterprise-wide adoption because mangement will begin to understand the benefits and see the backing of MS within their flagship WCF offerring.
Perhaps "hard-core" ALT.NETters and "Restafarians" will say they've been doing things like this without MS support for years, and I would not argue with that. However, most of us work in a heterogeneous world that involves a lot of layers of management and risk-mitigation. So, the extra support at an official level from Microsoft's platform can only help the general adoption curve of web technology.
And, regarding developers and architects, these groups of stakeholders have a lot riding on their technical choices and often face an uphill battle when the major vendor of their company's tools isn't yet "on board".

I and a few of my colleagues at various companies have been building REST-style (though I'd hesitate to call it full REST because of little attention paid to links and hypermedia constraints) for a efw years and have often faced skepticism because of the "That's not what WCF does" responses. Those responses were well-founded at the time, but it's also very nice to see how far MS has come with modernizing WCF to fully support the web and the HTTP specifications for all they offer and are worth.

For me this is a great step in the right direction, and I look forward to evaluating further the use of WCF HTTP WebAPI for backend resources / services.