On Jan 17, 2013, at 2:55 PM, Matthias Wessendorf <matzew(a)apache.org> wrote:
On Thu, Jan 17, 2013 at 8:00 PM, Kris Borchers
<kris(a)redhat.com> wrote:
> I'm pulling the conversation from IRC to this thread as I'm not sure if
I'm explaining my issue with offset/limit properly.
a quick summary ?
The summary followed on the next lines. :)
>
> Basically, my concern is we can not choose one between offset/limit and page/perPage.
The client libraries need to support both as both are popular server-side paging
implementations.
> We also can't just use one of those names and have it work both ways since that
would be confusing to developers.
Not sure I understand, perhaps due to lack of thread/understanding, but
We can override the actual name of the http request parameter. so if I
am doing this:
offsetParam="page"
offset=1
limitParam="perPage"
limit=5
this would translate into ?page=1&perPage=5 - right?
But this is what I find confusing. Calling something an offset and meaning page or vice
versa, has already tripped us up. Just think of what it will do to users trying to
understand our API. That is why I suggested a name change and the ability to specify what
type of paging is happening.
And the server (github in this case) I am going against would return
me some "collection". That's all the client need to understand.
>
> My suggestion is to name these two parameters something more generic like
locator/count where locator=page/offset and count=limit/perPage. Then in our configs we
would provide these options:
>
> pagingType {String} - determines the paging method to be used in calculating next
page, etc. and could be either "offset" or "page", default
"offset"
> locatorParam {String} - locator parameter name, default "offset"
> locatorValue {Number} - page index or offset
> locatorIdentifier {String} - the locator identifier name, default
"AG-Paging-Offset"
> countParam {String} - count parameter name, default "limit"
> countValue {Number} - items per page
> countIdentifier {String} - the count identifier name, default
"AG-Paging-Limit"
>
> Thoughts?
hrm, not sure if this makes the API a bit complicated. Or at least I
don't (now) see the benefit of that.
-M
>
> On Jan 17, 2013, at 12:23 PM, Summers Pittman <supittma(a)redhat.com> wrote:
>
>> On 01/17/2013 11:37 AM, Matthias Wessendorf wrote:
>>> Hi,
>>>
>>> based on today's IRC and mailing list discussions, I have polished the
>>> client side paging spec:
>>>
>>>
https://github.com/aerogear/aerogear.org/blob/client_paging_spec/docs/spe...
>>>
>>> Please review the document!
>>>
>>> Cheers!
>>> Matthias
>>>
>> +1, let's see how it works in actual implementation!
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/aerogear-dev
--
Matthias Wessendorf
blog:
http://matthiaswessendorf.wordpress.com/
sessions:
http://www.slideshare.net/mwessendorf
twitter:
http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev