Comparing the "Economics" of REST and RPC

Jeff Bone
Mon, 13 Aug 2001 02:43:37 -0500

"Mr. FoRK" wrote:

> I'm not seeing the discrepency between OO and REST.Maybe I don't do OO the
> way most people do.

Do your object models have methods other than GET, PUT, POST, and friends?  If
so, there's the discrepancy.

A pure REST design style would apparently decompose the problem domain into a
set of resources with uniform, generic interfaces --- those defined by HTTP
*solely* --- and that would be that.  None of this
http://localhost/SomeObject?method=foo stuff.  The REST argument is that then
you are simply tunnelling another specialized protocol through HTTP, and you're
losing the generality and (some of the) other desirable qualities of REST.

> I usually do object models (a simplified OMT style) and build things as
> properties that are either collections or just simple values.
> Mapping this to being served by a Web server - not just hacked in, but
> trying to follow a mapping of uri to object references and methods to
> interface methods - works pretty well.

Sounds reasonably RESTful, by my newfound understanding of what that means...

> Do you have a general example in mind of how OO and REST diverge?

I'm certainly not the keeper of the REST divining rod, but I have been working
through some experiments (some real, mostly thought) as I've gone through this
process...  I may take the time to write up some notes on a few of those at some
point.  Hang ten and we'll see if I have any cycles;  I feel like this effort
really requires a decent job given the complete lack of such examples to date,
so I'm inclined to let it marinade until ready. :-)