Take the 2-minute tour ×

I was recently reading this discussion at SO where somebody commented that not all applications are suited for a REST based architecture.
Here what I mean by "REST based architecture" is the whole thing with RESTful apis + HATEOAS. Most of the examples on web refer to the "coffee shop" example and they highlight the Hateoas part through the workflowy bit of creating an order --> update/confirm --> pay --> take delivery. So is REST most suitable for apps that has a prominent state-transition in them, or is it equally suited for other kinds of apps, where probably we should think more in terms of state transitions to have REST working for us

share|improve this question

1 Answer 1

up vote 1 down vote accepted

REST is equally suited for other kinds of apps, where we should think more in terms of state transitions. Constructing the User Interface with Statecharts is an excellent guide for how to approach this (if you can get a copy at a reasonable price). When you are reading it, just make sure you mentally replace "User Interface" with plain old "Interface".

share|improve this answer
what will say of traditional CRUD kind of application , something like petstore ? Can that be done in REST, or will it make sense to do it? –  redzedi Jun 18 '12 at 12:20
@redzedi yes it makes sense for a pet store. The resources you are CRUDing have states. For instance, a product may out-of-stock, which means it cannot be ordered, but it can be placed on back-order. Meanwhile another product may be discontinued, in which case it cannot be ordered or placed on back-order. These different states are ideally handled with state-charts. –  Tom Howard Jun 18 '12 at 12:31

Your Answer


