RE: Pagination (ISSUE-42)

On 15 Feb 2015 at 13:06, Tomasz Pluskiewicz wrote:
> On 2015-02-12 23:18, Markus Lanthaler wrote:
>> Do you realize that you just stated what the problem is? :-)
>> 
>>     Each API could define their *own* way for navigating between
>>     pages
>>
>> A Hydra-conformant client is expected to know what a Collection is,
>> what an IriTemplate is, etc. It can't be expected that such a client knows
>> anything else. So, how would it be able to understand the way navigating
>> between pages work in an arbitrary API if it isn't defined in Hydra?
> 
> Actually I think Hydra could even get away without defining Collections,
> however I see the benefit for clients to understand that a given Page is
> part of a collection.
> 
> However you miss my point about navigation. Hydra has all that is
> needed: Links and IriTemplates to point from one resource to another. It
> should not be important to the client what the actual properties are.

Sure. But all a client could then do is to blindly follow arbitrary links without knowing what to expect or why to follow them.


> Isn't that what hypermedia is about? Self-descriptive messages?

By giving those links and concepts a well-defined meaning we make messages self-descriptive.


> My concern is that when we start adding specialized properties for
> next/prev, offset/limit in the core spec, clients (and libraries) will
> have those hardcoded.

Right. Clients also have the HTTP protocol hardcoded, TCP/IP, DNS and a whole lot of other things. That's one of the most fundamental aspects of the Web. It decouples clients from servers by coupling both to a centralized standard instead of coupling them directly to each other.


> This means that whenever a new collection
> navigation is added, clients need to be updated. Otherwise they will not
> understand the responses. It is in fact introducing out-of-band
> information of sorts.

That's true and that's why we try to define the most basic form of collections. All other, more sophisticated controls can be brought back to this simple model. The other way doesn't work.


--
Markus Lanthaler
@markuslanthaler

Received on Sunday, 22 February 2015 19:51:45 UTC