Re: Prefetching VS HATEOAS

Erik Wilde <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <[email protected]>
hello shea.

On 2013-04-17 12:13 , Shea Levy wrote:
> Often when designing REST interfaces for relational resources, I run
> into a tension between the efficiency of prefetching a related resource
> when one is requested on the one hand and the simplicity, elegance, and
> generality of referencing related resources via hypermedia. Does anyone
> have any advice on how best to manage that tension?

maybe i am misreading what you're saying, but i don't really see a 
tension in the sense of a conflict, more a design trade-off. prefetching 
is on the implementation level (it seems), and you would prefetch 
something based on the assumption that a request to a linked resource 
would be received soon, right? the tricky part probably is to avoid 
making prefetching stateful, assuming that the request for the related 
resource will be processed by the same server (if you have more than 
one). so if you make prefetching stateful, you run the risk of making it 
unlikely to actually provide you the benefit it can provide in a more 
stateful setting. so i guess in the end my answer would be: don't start 
implementing stateful patterns based on perceived performance benefits 
that rely on your service behaving in a stateful way.

cheers,

dret.

-- 
erik wilde | mailto:[email protected]  -  tel:+1-510-2061079 |
            | UC Berkeley  -  School of Information (ISchool) |
            | http://dret.net/netdret http://twitter.com/dret |
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.