Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In REST terms - the 'alternate views' are really just plain old resources because URIs are opaque. Relationships are discovered by following links from one to the other - in this case; from list of articles, to an article, to edit and delete that article. The key here is that it actually doesn't matter about your URI structure at all, i.e. the following are equally 'correct':</p> <pre><code>GET /article/123/edit GET /article/123;edit </code></pre> <p>The answer really is just a matter of taste. Provided they are identified by a URI, and can therefore be linked to, then you are Doing It Right.</p> <blockquote> <p>How would you map the above URI structure to UIs served to the regular user, considering that there can be several views per each resource?</p> </blockquote> <p>I would do this in exactly the same way as the HTML application works - i.e by providing the same hyperlinks in XML so as to connect/link up the resources (views) for the client to follow and render in the UI as necessary.</p> <p>e.g.</p> <pre><code>GET /article/foobar 200 OK Content-Type: application/mytype+xml .... &lt;link rel="edit" href="/article/foobar;edit" /&gt; .... </code></pre> <p>lastly:</p> <blockquote> <p>Do you agree with the possible solution detailed above, or would you recommend a different approach based on your experience?</p> </blockquote> <p>I think your approach above is reasonable - however, you should definitely focus on link relations rather than URI patterns.</p> <p>You could opt to keep things 'larger grained' and avoid separate delete (or even edit) resources for your XML driven application; simply by not linking to them in the XML and instead opting to include the delete/edit links and forms in the article resource itself - this would work fine alongside your initial proposal for the HTML driven version.</p> <p>I general, the approach of using the same resources for the XML and HTML driven applications is a good one.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload