HATEOAS (Hypermedia As The Engine Of Application State)

Links between resources drive the state of peers, clients and servers. These hyperlinks provide transitions between the states of a given resource. Each resource representation has at least one link to another resource, thus creating hypermedia. Clients learn the state of a resource and it’s relationship to other resources through it’s resource representation.   This is the principle that enables HTTP and HTML to weave the World Wide Web.  A browsers points to a web page (resource),  the server responds with the page, the browser then reads the page and requests all the images, scripts, style sheets, and pages referenced in frames and iframes (resources).  Finally, the browser renders the page using each resource where it’s needed.  The rendered page often contains numerous links to other pages or files (resources). This structure allows people to surf the web on the waves of hypermedia.

REST – Representational State Transfer

In 2000, Roy Thomas Fielding published his Doctorate Dissertation: Architectural Styles and the Design of Network-based Software Architectures.  Doctor Fielding introduced a number of ideas critical to the growth and evolution of the web.  The heart of these ideas is REST. In recent years, REST and RESTful web services have enjoyed great success and popularity.  Doctor Fielding said it best in the following citation:

“Representational State Transfer (REST) architectural style for distributed hypermedia systems, as it has been developed to represent the model for how the modern Web should work. REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems.”

Contrary to popular belief, REST is NOT simply a means to implement Remote Procedure Calls (RPC) through a well crafted URL.  REST is primarily concerned with managing, retrieving and linking resources in such a way that it may effectively scale without bound.

Concisely stated, REST is an architectural style built on the following four ideas:

  • HATEOAS (Hypermedia As The Engine Of Application State)
  • Resources representing people, places, things, and other nouns
  • Global identifiers to access resources
  • A mapping between application behaviors and the application code