[aerogear-dev] paging: different client platforms
Kris Borchers
kris at redhat.com
Fri Jan 11 12:32:07 EST 2013
On Jan 11, 2013, at 11:23 AM, Summers Pittman <supittma at redhat.com> wrote:
> On 01/11/2013 12:11 PM, Douglas Campos wrote:
>> Yeah, mixing the context (state) with the actual data.
>
> I like how simple and compact it makes things. Also it lets UI controls
> be much simpler, and it doesn't make us rely on something like
> WeakHashMap to clean up old contexts and such.
>
> IN either case, should the next() method block until Pipe.read()'s
> callback is called or should next consume a callback to be called after
> Pipe.read()'s callback is called?
At least in JS land, I hadn't intended on implementing a next() method. I was leaving that up to the UI implementation. I was just planning to give access to the paging info and let the dev do as they please with it.
>
>> On 11/01/2013, at 15:06, Summers Pittman <supittma at redhat.com> wrote:
>>
>>> On 01/11/2013 11:55 AM, Douglas Campos wrote:
>>>> What about returning a PagedList<T> (and using guava's ForwardingWhatever to decorate the list with the paging info)?
>>>>
>>> So something like PagedListExample?
>>> https://gist.github.com/d835d4a56d4d25e4ca9a
>>>> On 11/01/2013, at 14:14, Summers Pittman <supittma at redhat.com>
>>>> wrote:
>>>>
>>>>
>>>>> On 01/11/2013 07:46 AM, Matthias Wessendorf wrote:
>>>>>
>>>>>> Of course, sending simple request parameters to the server is easy, in
>>>>>> every library
>>>>>>
>>>>>> (using Dan's CURL client example)
>>>>>>
>>>>>> ```
>>>>>> URL=
>>>>>>
>>>>>> "http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo"
>>>>>>
>>>>>>
>>>>>> curl -i --header "Accept: application/json" "$URL/cars?page=0&perPage=4"
>>>>>> ```
>>>>>>
>>>>>> In terms of an client API, that wants to scroll through the cars (like
>>>>>> in this demo), I was wondering if some "PagingContext" (or
>>>>>> "ResultSet") API is needed...
>>>>>>
>>>>>> // issues a request with ?page=0&perPage=4
>>>>>> PagingContext pc = client.request(someCars...);
>>>>>>
>>>>>> // issues a request with ?page=0&perPage=4
>>>>>> pc.next()
>>>>>>
>>>>>> // issues a request with ?page=1&perPage=4
>>>>>> pc.next()
>>>>>>
>>>>>> // issues a request with ?page=0&perPage=4
>>>>>> pc.back()
>>>>>>
>>>>>>
>>>>>> NOT sure, but IMO a little higher level abstraction would be nice,
>>>>>> instead of having the end users of the "paging API" applying the
>>>>>> values for 'page' and 'perPage' manually.
>>>>>>
>>>>>> Any thoughts? (Not sure if this has been brought up before)
>>>>>>
>>>>>> -M
>>>>>>
>>>>>>
>>>>> +1 for a higher level abstraction
>>>>>
>>>>> As far as how it will mesh with Pipe and such I am thinking
>>>>>
>>>>>
>>>>> https://gist.github.com/4511860
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On Fri, Jan 11, 2013 at 12:39 PM, Matthias Wessendorf
>>>>>>
>>>>>> <matzew at apache.org>
>>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> was there already some discussion (and proposal) for paging APIs on the client ?
>>>>>>>
>>>>>>> It would be nice if the public client API semantics are somewhat
>>>>>>> identical on the different platforms.
>>>>>>> (I guess it's a MUST :))
>>>>>>>
>>>>>>> Any pointers to gists etc are welcome
>>>>>>>
>>>>>>> Thx
>>>>>>>
>>>>>>> --
>>>>>>> Matthias Wessendorf
>>>>>>>
>>>>>>> blog:
>>>>>>>
>>>>>>> http://matthiaswessendorf.wordpress.com/
>>>>>>>
>>>>>>>
>>>>>>> sessions:
>>>>>>>
>>>>>>> http://www.slideshare.net/mwessendorf
>>>>>>>
>>>>>>>
>>>>>>> twitter:
>>>>>>>
>>>>>>> http://twitter.com/mwessendorf
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> aerogear-dev mailing list
>>>>>
>>>>> aerogear-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>>
>>>> aerogear-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>> _______________________________________________
>>> aerogear-dev mailing list
>>> aerogear-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
More information about the aerogear-dev
mailing list