Only Send What You Need
<p>Managing RESTful AJAX operations is an <a href="http://www.ajaxpatterns.org/RESTfulOperations">open problem</a>. While I say that <a href=/?m=asynchronous-rest">aspects of managing HTTP requests, and designing UI feedback cannot be understood in isolation and must be integrated</a>, I still think there are two distinctive and separate issues to consider.</p> <p>For starters, HTTP has always been stateless, that's it's fundamental form. So in some ways, talking about asynchronous representational state could be pretty meaningless, but it becomes far more interesting when we consider the differences between "pages", "services" and "resources".</p> <p>The basic concept of the HTTP protocol is of a set of request types - the verbs that act on the nouns representing each resource. The fundamental format of a resource is a page, but practically, it could be anything. In contrast, the concept of a web service is often related to the notion of a remote procedure call, treating HTTP as the way to transmit access an object and return the results of a method, usually without needing to consider the URI as representing an actual resource. Remote procedure calls mostly return generic data structures or a "message", usually in XML format.</p> <p>In AJAX land where the dominant metaphor of pages is changing towards one of "containers", there are two kinds of requests:</p> <ol>
<li>Requests that modify and store content on the server</li> </ol>
I haven't yet seen much discussion that attempts to separate the distinct issues that arise from these two separate aspects. I think the first of these aspects is pretty well understood - the notion of "only load what you need" is familiar to many developers, but it's the second that interests me the most.