Two Perspectives on HATEOAS

HATEOAS or “Hypermedia As The Engine Of Application State” is one of the core principles of REST and it essentially boils down to having links in the representations of your resources.  How to apply this principle in the design of a service and the benefits that it provides depend on the nature of the service you are building, i.e. whether your service is more process-centric or data-centric.  What I mean by a process-centric service is a service that’s more focused on  exposing or sharing some business process or capability with its clients.  A data-centric service on the other hand is more focused on exposing or sharing some piece of data.  Of course, services can be both, but most of the services I’ve seen tend to be one or the other.  So how is HATEOAS applied to these two types of services?  With process-centric services, as the client interacts with the service, it progresses along the steps of the process until finally the desired goal is achieved.  With these types of services HATEOAS is used to enable the clients to progress to subsequent steps or states of the process, i.e. the links in the resource representations are transitions that take the client to the next state in the process.  With data-centric services, as clients interact with the service, they are accessing (reading or writing) the data provided by that service. Typically the client will also explore and access other related data as I wrote about in a previous post.  In this case, HATEOAS is used to express the relationships with the other related data, i.e. the links in the resource representations allow the client to easily traverse the rich relationships and access related data.

This entry was posted on Sunday, October 4th, 2009 at 10:08 pm and is filed under architecture, REST, SOA.

You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

Leave a Reply

*