Re: Resource definition

Geoff Arnold <[email protected]>
Newsgroups gmane.comp.web.services.ws-arch
Message-ID <[email protected]>
Mark Baker wrote:

> One doesn't need to talk about a switch, or the movement of a switch, or
> even a toggleSwitch() method, in order to effect a state change with the
> bulb, because the interaction style is one of *state transfer*; if I
> want to turn the bulb on, I just do a HTTP PUT containing a
> representation of the "on state" to the URI identifying the lightbulb.


Representing action as state transfer is unnatural in many situations and
wholly impractical in others. For example: consider a TroutPond resource
which contains an arbitrary number of Trout. How, pray, do you render
the action RemoveAllDeadTrout() as a state transfer?  One could,
I imagine, HTTP GET the entire pond state, compute the subset pond
containing only non-dead fish, and then HTTP PUT the result, but
idempotency, scalability, and common sense would seem to rule that out....
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.