Library tutorials & articles

REST and .NET 3.5 Part 1 - why REST based services?

Is REST perfect?

So if REST is so great should I always build my systems as REST based ones? Well some people would argue that but there are issues in REST.

No metadata

As may be apparent from the REST benefits above, REST is a pragmatic way of building services and this pragmatism currently means there is no metadata. In other words the consumer has to implicitly know what a service requires and what it may return. Hopefully testing the application should drive out whether assumptions about message formats are correct and the pragmatism does not absolve the service provider from taking a responsible attitude to service evolution.

No standard for actions

The next valid actions are a crucial concept in REST and yet there is no standard way of encoding this information and no agreed place of putting this information. There has been some discussion about using ATOMPub as a mechanism but this is far from an agreed standard.

Tooling is rudimentary

On the .NET platform there is little tool support for consuming REST services. With the lack of metadata you are left with having to consume the saw format of the message whether this XML, JSON, an image or something else. There is growing support on the service side with .NET 3.5 WCF extensions and the upcoming ASP.NET routing infrastructure shipping in .NET 3.5 SP1.

Conclusion

REST is a very powerful way to build services. The model lends itself to high scalability as it uses the same model as the web. It is particularly applicable to services that are exposed on to the public internet as generally all a consumer needs to be able to do is manipulate XML and talk HTTP - which every platform supports.

In the first part of this article I have introduced REST and outlined its benefits and issues. In part two I will show you how to build and consume REST based services using WCF, ASP.NET and LINQ to XML.

Comments

  1. 14 Nov 2008 at 18:36
    Is anyone interested in working on Windows Live Social Networking site? This is all done in C# and ASP.Net with a little Ajax. -Ryan Phillips engineerfinder@live.com
  2. 14 Nov 2008 at 17:42
    Erm, except Amazon exposes all of their APIs via SOAP. It's not really and apples-to-apples comparison either, because both Google and Yahoo cite ease of use/low barrier to entry as being a talking point on why they're not or are no longer supporting SOAP. The fact is, all the APIs that I know of that they're currently exposing are really targeting presentation layer logic and mashups. SOAP really wasn't designed to be as lightweight or included in client-side logic; by comparison, Amazon's services really target enterprise developers, and as such many more people wind up using SOAP to access their services than used it with Google's API when they were still offering the service. Google and Yahoo offer maps, search, and the like, while Amazon offers asynchronous queues (who uses queues for a lightweight mashup?), fault-tolerant storage, and scalable servers. I agree with most of what you're saying, just wanted to point that out; most sites aren't switching to REST because its merits, but because its lower learning curve draws in a larger potential developer base.
  3. 01 Jan 1999 at 00:00

    This thread is for discussions of REST and .NET 3.5 Part 1 - why REST based services?.

Leave a comment

Sign in or Join us (it's free).

Richard Blewett Richard is the CTO of DevelopMentor UK. He began life as a mainframe programmer writing ALGOL and COBOL, but jumped to OS/2 after a year. In 1995, he started developing under Windows and got his fi...
AddThis

Related podcasts

Events coming up

  • Nov 18

    15 Minutes of Fame

    Dresher, United States

    This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.

Want to stay in touch with what's going on? Follow us on twitter!