code

Create Java Hypermedia REST Web Services Tutorial (HATEOAS)

Here is a very nice tutorial in spring.io explaining how to create Hypermedia REST Web Services (HATEOAS)  in Java.

For those those that don’t know what HATEOAS is here is a short description:

HATEOAS is a REST application architecture in which the application’s  REST API is not fixed. Instead the available business operations are provided by the same web service and may vary upon state.

For example instead of writing a web service for a car dealer that buy and sell cars, you may write a  HATEOAS service in which when the car dealer is called (probably through a GET request) the response includes the link of the sell and buy operations. In that way when the car dealer is out of money the response will omit the link for buy. On a classic web service the buy link would be always available and an error handling inside the buy service should check if the car dealer has enough money or not.

You can read more here.

Interesting reads:

https://spring.io/guides/gs/rest-hateoas/
https://spring.io/understanding/HATEOAS
projects.spring.io/spring-data-rest/

 

Leave a Reply

Your email address will not be published. Required fields are marked *