2

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

Community
  • 1
  • 1
redzedi
  • 1,957
  • 21
  • 31

1 Answers1

1

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".

Tom Howard
  • 6,516
  • 35
  • 58
  • 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