Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using REST principles and HTTP semantics in-process <strong>definitely does make sense</strong>, but probably only if your application also eventually is a client or server communicating with HTTP.</p> <p>The hard part is honoring the <strong>layered constraint</strong> of HTTP since it's so easy to call that singleton on the other sie of the layer, since it's just a function call away.</p> <p>One benefit, however is that you can in fact move a layer from one place to another. It's probably hard to achieve this fully, but I think it's doable, although I'll hazard a guess that it's never been done.</p> <p>In my own thought experiments for this all of the benefits of HTTP come into play, in ways that mere memcached or in-process caches can't handle it. Take, for example cache validation, or conditional puts. Imagine being able to make a function call with the expressiveness of a HTTP request:</p> <blockquote> <p>retrieve this thing from this service, but only if its ETag isn't "A" or "B" or W/"C", since those are the ones I have at the moment</p> </blockquote> <p>Or</p> <blockquote> <p>store this over here, but only if the ETag W/"DEF" is still valid, since that's the tag I used when I did my GET just now.</p> </blockquote> <p>and </p> <blockquote> <p>I'd like to search for widgets like this, and have the result preferably as an IAtomCollection, but i'll take a List instead (<strong>Accept</strong>). The last time I asked this question I got an ETag of "foo" (<strong>If-None-Match</strong>), so I don't need it if it didn't change, but if you don't mind, I'd like to verify the validity of my cache with the origin server (<strong>Cache-Control: must-revalidate</strong>). Oh and by the way here are my credentials (<strong>Authorization</strong>).</p> </blockquote> <p>Questions like these are so easy to do in HTTP, and we all know how to forge such complicated queries.</p> <p>The same goes for HTTP responses:</p> <blockquote> <p>Hi, I found your IAtomCollection, and I did actually verify it with the origin server. The thing you have isn't valid any more, so here's a new one for you. It has the ETag of "bar", and you're allowed to consider it fresh for two minutes without revalidating with me, but if I'm gone the next time you ask, you can extend the freshness period for another minute. And of course the response varies based on your credentials (goes without saying, right?) and your preferences.</p> </blockquote> <p>Again, plain old HTTP. Imagine being able to make method calls that are <em>that</em> smart!</p> <p>As for HATEOAS, putting some thought into encapsulating identifiers would make it possible to honor that constraint too. But my thought experiments haven't gone very far in this direction...</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.
    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