[PRL] REST?

Mitchell Wand wand at ccs.neu.edu
Thu Feb 17 15:59:26 EST 2005


>> Hmm, looking at LtU, I found a discussion that talked about REST APIs
>> vs PITA APIs.  I finally found that PITA was an acronym for Pain In
>> The A**, but that REST was the name what appears to be the Web Design
>> Pattern du Jour. (or maybe the "Distributed Software Architecture" du
>> Jour). 

DH> The world abounds in PITA API's, as we all know. ;)

DH> As for REST vs. continuation-based, Anton van Straaten has something to 
DH> say about this. His talk at LL4 was about the two approaches, although I 
DH> didn't understand what he was trying to say. I talked to him afterwards, 
DH> and he said he'll try to write up his ideas -- he still hasn't, so I 
DH> think I'll give him a poke.

DH> (I have yet to even understand what is espoused by the REST 
DH> architectural style. Frankly, I'm skeptical of any methodology that 
DH> can't give you a straight answer to "what is it?")

Thanks.  Those slides were very helpful.  

So far as I can tell, the basic idea of REST is that the web is a
fixed, finite-state machine whose nodes are pages (or resources, or things
addressed by URLs, or something like that), and that a client
navigates in this automaton by going to appropriate URLs.  

Just like what you have in automata theory: You are at a URL, and you
get a menu of other URLs, and you give input to the automaton, which
gets you to one of the URLs.

In particular, this means that the server doesn't have any state:  the
page you get back from any request (URL) should be the same every time
(at least during the span of any transaction...).  

In this model, "Session keys" are considered bad, because most likely
they point to state on the server.

So the PLT continuation model seems entirely consistent with that
approach.  The canonical send/suspend URL, eg

http://blah/blah/blah/;id1073*k1-173096376

is just a URL for an automaton state (ie a page) that is constructed
lazily.  

So long as the translation from continuations to pages is functional,
this seems to match the REST model quite well.

--Mitch 






More information about the PRL mailing list