This is a single archived entry from Stefan Tilkov’s blog. For more up-to-date content, check out my author page at INNOQ, which has more information about me and also contains a list of published talks, podcasts, and articles. Or you can check out the full archive.

Comments on REST Design

Stefan Tilkov,

Someone I don’t know linked to one of my many SOAP-vs.-REST posts and provided interesting comments:

It doesn’t make sense that a customer should know her collection of orders

I disagree; if I’m building a CRM system, viewing orders as subordinate resources to customers is definitely an option. But I think there’s “right” or “wrong” here, this is just the typical differences in design aesthetics.

or that you should ask a customer (via POST) to create an order. This operation should be restricted to the /orders collection.

Similar, but more understandable. Still, creating a new order for a customer can be seen as a subordinate resource … this makes me think a little more, though.

I also think /order/{id} is incorrect and /orders/{id} would be more elegant.

Absolutely correct, that was the way it was actually supposed to be (my mistake when creating the diagram).

Maybe we shouldn’t use the word design. It’s terribly misleading. Maybe we should talk about “architectural styles” Then people might realize what’s happening is construction and not specification.

I don’t really understand this comment, but I’ll note that “architectural style” can be just as misleading as many other pseudo-technical terms. (I know there’s the definition in Roy’s thesis, but that doesn’t mean people who use that term have read it.)