title: REST and links: middle ground?
body: <p>I've been wondering about how far to go with links in REST. Consider books which have authors, but there is obviously a many-to-many relationship between books an authors (a book can be written by multiple authors, and authors can write multiple books).</p>
  
  <p>So let's say we have a rest call <code>http://server/book/21</code>, which will return a book XML, containing information about an author. Now since the book is a resource, and the author is a resource, the XML should not straight up include all the author information. It should contain a link to the author information. But which of the below two examples is more widely accepted?</p>
  
  <p>(Excuse my crappy formatted XML, I am not that experienced with hand writing XML)</p>
  
  <pre><code>&lt;book&gt;
    &lt;title&gt;Some Book&lt;/title&gt;
    &lt;authors&gt;
      &lt;author link="http://server/author/82"&gt;Some Guy&lt;/author&gt;
      &lt;author link="http://server/author/51"&gt;Some Other Guy&lt;/author&gt;
    &lt;/authors&gt;
  &lt;/book&gt;
  </code></pre>
  
  <p>Then, an author link would return more information:</p>
  
  <pre><code>&lt;author&gt;
    &lt;name&gt;Some Guy&lt;/name&gt;
    &lt;dateOfBirth&gt;some time&lt;/dateOfBirth&gt;
  &lt;/author&gt;
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>&lt;book&gt;
    &lt;title&gt;Some Book&lt;/title&gt;
    &lt;authors&gt;http://server/book/21/authors&lt;/authors&gt;
  &lt;/book&gt;
  </code></pre>
  
  <p>Where <code>http://server/book/21/authors</code> returns:</p>
  
  <pre><code>&lt;authors&gt;
    &lt;author link="http://server/author/82"&gt;Some Guy&lt;/author&gt;
    &lt;author link="http://server/author/51"&gt;Some Other Guy&lt;/author&gt;
  &lt;/authors&gt;
  </code></pre>
  
  <p>And then each of those returns the former <code>&lt;author&gt;</code> example again.</p>
  
  <p>The reason I'm asking is basically because at my job they went with the second approach, and it seems to me that clients have to take many more steps to reach where they want to go. Also, for basic information which "you're always going to need" (author's name), you do have to take one additional step.
  On the other hand, that way the <code>book</code> resource only returns information about the book (nothing else), and to get anything else, you have to access other resources.</p>