Thursday, April 03, 2008

URI as Contract

When working on Mojo, one of the first things we did was to come to an agreement on the API that the application would use. I think we went in this direction early as we had always intended for the Mojo to be used as an 'widget' platform to access the Web21C SDK Services. I think it was a great move, and I'd certainly recommend this, even if you don't intend your web app to have an API.

With modern REST based web apps, we tend to think about the URI a lot more along with what to POST or GET to that URI. There are no real rules, and as such - toolkits, to help the developer with building REST-friendly URIs, it's more of a mind set. I won't repeat those rules here, but it essentially boils down to cool URIs and being mindful of resources.

The part where can come stuck is thinking in terms of actions or methods, it's something we all have to get used to, but I truely believe that if you invest a little time to agree URI as contract, it'll save headaches later on.

No comments: