On 9/18/06, Vincent <[EMAIL PROTECTED]> wrote:
[...]
Yes, but objects have state *and* behaviour. All the REST articles I've seen so
far conveniently ignore the behaviour part by carefully choosing examples where
the server does not need to perform any business logic (e.g. the ATOM protocol,
which is touted as the ultimate REST application).

I don't know about those articles that you've read but that
implication is certainly false. The server may well be doing all sorts
of work.

It seems to me that all these
articles are saying is 'use setters on your objects, and save the object when
you're done'.
This forces me to do:
    rectangle.setCenterX(12);
    rectangle.setCenterY(34);
    rectangle.save();
When what I really want to do is:
rectangle.translate(4,6);

Of course you can do that, it doesn't force you to break things down
any more than creating any programmatic API forces you to do so.  You
could just as easily have a translation "function" and invoke that.  I
mentioned this issue in my first reply (and used the example of a
"view" in a database like Oracle).


> In conclusion, try to think in term of resources addressable by
> URIs and document exchanges instead of remote objects and remote
> method calls. The documents can be either the representations of
> resources or the representation of the intended state of a resource,
> or the entity to be processed by a processing/service resource.

I interpret this as: whenever you find yourself needing  a semantic richer than
what setters have to offer, use the Command Pattern AND treat commands as
resources.
At first sight, it seems to me like turning a command into a resource is just a
trick that allows you to say 'oh no, no, no, I'm not using RPC at all! I'm a
true RESTfarian, you see'.

You keep bringing this RPC vs. REST thing up.  That's a false
dichotomy and I think it's just confusing things for you.  If you
must, you should be clear to talk in terms of something specific like
SOAP or Java's RMI or any number of similar approaches.  Perhaps it
would help if you thought of the URIs/URLs more like Java or CORBA
interfaces.

Hope this helps,
John

Reply via email to