The RESTfulness of Speech Acts

Share the article!

The four verbs of REST (i.e. GET, POST, PUT, DELETE ) have always seemed to me as subset of Speech Acts. However, I never had the time to really think of precisely what that subset was.

Fortunately, Bob Haugen in one of the comments pointed me to this gem of an paper. The authors propose any “pragmatic action” as a triple. A triple that involves an intention, an action and a object.

The intentions are propose, accept, reject, declare, query, reply, assert (i.e. Illocutionary). The actions are create, change, cancel, none (i.e. Perlocutionary). The objects are Agreement, EconomicContract,
EconomicComitment, and EconomicEvent. The paper is slanted toward supporting business based messaging, however we can take the liberty of generalizing it a bit.

The interesting thing to notice is how the action parts seem to neatly match the verbs found in REST. That is PUT=create, POST=change, DELETE=cancel and GET=none.

With these triples you can build up several business transaction patterns:

  • Commercial Transaction Pattern – Requesting activity carries the pragmatic action (Propose, Create, aContract),
    Responding activity carries the pragmatic action (Accept, Create, aContract),
    OR Responding activity carries the pragmatic action (Reject, Create, aContract).
  • Query/Response Pattern – Requesting activity carries the pragmatic action (Query, None, anyObject)
    Responding activity carries the pragmatic action (Reply, None, anyObject).
  • Request/Response Pattern – Requesting activity carries the pragmatic action (Query, None, anyObject),
    Responding activity carries the pragmatic action (Reply, None, anyObject).
  • Request/Confirm Pattern – Requesting activity carries the pragmatic action (Query, None, aComittment/aContract),
    Responding activity carries the pragmatic action (Reply, None, aComittment/aContract).
  • Information Distribution Pattern – Requesting activity carries the pragmatic action (Assert, None, anyObject),
    Responding activity carries no pragmatic action.
  • Notification Pattern – (Declare, Create, aComittment/aContract)

So, if we adopt REST’s existing structure where the action part is contained in the envelope. It like inverting the Speech Act hierarchy (i.e. Perlocutionary -> Illocutionary -> Propositional -> Utterances ). Then everything really matches elegantly. The REST verbs are Perlocutionary utterances (i.e. intention to affect behavior). The REST resources are the Illocutionary (the intention to interact) and Propositional utterances (references to other things).

The REST Architectural style in essence encompases in a very clean way the Theory of Speech Acts. Hard to get any more elegant than that!


Share the article!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>