title: HATEOAS and Microservices
body: <p>I'm having some serious trouble seeing how HATEOAS and Microservices can co-exist.</p>
  
  <p>Let's take an example:</p>
  
  <p>Let's say we have a shopping cart resource.
  And we need to put snapshots of products into it, e.g. product Id, product price; snapshot of current price when item was added to cart, and possibly some other values.
  The actual use-case is not relevant, but just to get some idea on the problem at hand.</p>
  
  <p>When I have been doing HATEOAS earlier, I would have put a link in the shopping cart resource that links to products or a template url that links to a specific product.</p>
  
  <p>This way, the client can still be ignorant of resource URL's.</p>
  
  <p>But in the microservice world, a service should have no knowledge of other services. AFAIK.</p>
  
  <p>So how could they both work together?</p>
  
  <p>My interpretation of microservices is that they can never link to anything else than themselves, which would pretty much be a <code>Self</code> link.</p>
  
  <p>I've found the same question asked on ther places, e.g.
  <a href="https://groups.google.com/forum/#!topic/api-craft/YRkLFVY_zFc" rel="noreferrer">https://groups.google.com/forum/#!topic/api-craft/YRkLFVY_zFc</a></p>
  
  <p>Where solutions like "macro services" that weave all this together is used.
  Which doesn't seem like a clean way to solve things.</p>
  
  <p>[Edit]</p>
  
  <p>I've found some more nice info on the topic:
  <a href="https://github.com/Netflix/eureka" rel="noreferrer">https://github.com/Netflix/eureka</a>
  <a href="https://github.com/RestExpress/HyperExpress" rel="noreferrer">https://github.com/RestExpress/HyperExpress</a></p>
  
  <p>This seems nice to have some tool augument the resources with links, but this makes me think, where does the logic to decide what links a resource should have belongs?
  In the service that exposes the resource?
  In the central service registry?</p>