Question

I'm looking for a concret example in WOA/HATEOAS !

I read a lot of blogs and see a lot of presentations about HATEOAS but never an example ...

How can you implement the client side ?

Really, when you're making HTML5 applications with Backbone, AngularJS, Ember, Knockout ... how can you make HATEOAS ?!

In Backbone for example how to set dynamically the 'url' property of your model retrieving the resource from server ?

Thx for your replies guys !

Best regards,

Thomas Pons.

Was it helpful?

Solution

The point of HATEOAS is that you are getting links on other resources from responses on your requests. Difference, in comparison with URL Templates, is that the client knows, has hardwired, just few URLs (entry points), and the rest of URLs is getting from responses on the fly. It brings loose coupling between client and server and that's main benefit of HATEOAS.

Working with HATEOAS is same as surfing on Web, you just click on a link that is included in last response (e.g. HTML page), then again, and again. Point is that you don't know all the URLs before you get first response on URL that you know, the entry point.

Today, HATEOAS is not well adopted, unfortunately. Most of APIs are publishing URL templates, and that means tight coupling; so I think you cannot expect support from existing frameworks now, but it's not so hard to implement your own URL repository, on client, that will collect URLs from responses you get.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top