Re: Filters as views (ISSUE-45)

January 12 2016 11:53 PM, "Markus Lanthaler" <markus.lanthaler@gmx.net> wrote:

> On 12 Jan 2016 at 22:10, Karol SzczepaƄski wrote:
> 
>> Hi Markus
>> 
>>> If you don't like this approach, could you please point out in the examples
>>> what exactly you don't like. Could you, in that case, please also rewrite
>>> the examples to illustrate how you would see this working with the
>>> alternate
>>> proposal.
>>> 
>>> From my perspective is good enough as it doesn't create separate constructs
>> 
>> for paging and filtering - in both examples presented we're using views
>> which I like. I'd probably prefer to move both to the term of 'filter'
>> (as I had this conversation with Ruben), but still being consequent here
>> is OK for me.
>> 
>> The only objection I could made is that whe we're not keen to move the
>> paging to that templating mechanism as well:
> 
> Actually, this proposal paves the way for that :-)
> But let's first see if we reach consensus on the proposed design.

I'm all for it. This is what I meant yesterday when I wrote that paging and filtering are two sides of the same coin - resource derivation. I find your design abstract enough so that it doesn't make any assumptions about the nature of the original and derived resource

One thing I'm thinking about is inverting the resource/view relation in representation. I think it's been discussed so please bear with me. What were the cons of having the view "first"?

{
"@id": "/collection?page=2",
"@type": "PartialCollectionView",
"first": "/collection?page=1",
"previous": "/collection?page=1",
"last": "/collection?page=2",
"viewOf": {
"@id": "/collection",
"totalItems": 2345,
"member": [ ... ]
}
}

Received on Wednesday, 13 January 2016 07:40:48 UTC