Some new questions : <div><br><div><font size="4"><b>JavaScript</b></font></div><div><font size="4"><b><br></b></font></div><div><pre style="font-size:13px;line-height:19px;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="nx">cars</span><span class="p">.</span><span class="nx">updatePageConfig</span><span class="p">({</span>
<span class="nx">offset</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">2</span><span class="p">,</span>
<span class="nx">limit</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">10</span>
<span class="p">});</span></pre><div>can we also shortcut this way ?</div><div><br></div><div><pre style="font-size:13px;line-height:19px;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="nx">cars</span><span class="p">.</span><span class="nx">read</span><span class="p">({</span>
<span class="nx">page</span><span class="o" style="font-weight:bold">:</span> <span class="s2" style="color:rgb(221,17,68)">"prev"</span><span class="p">,</span>
<span class="nx">pageConfig</span><span class="o" style="font-weight:bold">:</span> <span class="p">{</span>
<span class="nx">offset</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">2</span><span class="p">,</span>
<span class="nx">limit</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">10</span>
<span class="p">},</span>
<span class="nx">success</span><span class="o" style="font-weight:bold">:</span> <span class="kd" style="font-weight:bold">function</span><span class="p">(</span> <span class="nx">data</span> <span class="p">)</span> <span class="p">{</span>
<span class="c1" style="color:rgb(153,153,136);font-style:italic">// do something</span>
<span class="p">},</span>
<span class="nx">error</span><span class="o" style="font-weight:bold">:</span> <span class="kd" style="font-weight:bold">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1" style="color:rgb(153,153,136);font-style:italic">// handle it</span>
<span class="p">}</span>
<span class="p">});</span></pre></div><div><br></div>Another alternative : What about removing the "page" attribute and include a "action" attribute inside a "paging" block ? If paging block isn't present we implicitly know we don't want paging :</div>
<div><br></div><div><pre style="font-size:13px;line-height:19px;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="nx">cars</span><span class="p">.</span><span class="nx">read</span><span class="p">({</span>
<span class="nx">paging</span><span class="o" style="font-weight:bold">:</span> <span class="p">{</span>
<span class="nx">action</span><span class="o" style="font-weight:bold">:</span> <span class="s2" style="color:rgb(221,17,68)">"prev"</span><span class="p">,</span> <span class="c1" style="color:rgb(153,153,136);font-style:italic">//can be "next"</span>
<span class="nx">offset</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">2</span><span class="p">,</span> <span class="c1" style="color:rgb(153,153,136);font-style:italic">//optional</span>
<span class="nx">limit</span><span class="o" style="font-weight:bold">:</span> <span class="mi" style="color:rgb(0,153,153)">10</span> <span class="c1" style="color:rgb(153,153,136);font-style:italic">//optional </span>
<span class="p">},</span>
<span class="nx">success</span><span class="o" style="font-weight:bold">:</span> <span class="kd" style="font-weight:bold">function</span><span class="p">(</span> <span class="nx">data</span> <span class="p">)</span> <span class="p">{</span>
<span class="c1" style="color:rgb(153,153,136);font-style:italic">// do something</span>
<span class="p">},</span>
<span class="nx">error</span><span class="o" style="font-weight:bold">:</span> <span class="kd" style="font-weight:bold">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1" style="color:rgb(153,153,136);font-style:italic">// handle it</span>
<span class="p">}</span>
<span class="p">});</span></pre><div class="gmail_quote"><br></div><div class="gmail_quote"><font size="4"><b>General remark </b></font></div><div class="gmail_quote">Do we want to describe in the specs the following use cases ?</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">- Calling previous on the first page</div><div class="gmail_quote">- Calling next on the last page</div><div class="gmail_quote">- Setting an offset > total number of pages</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Jan 16, 2013 at 1:19 PM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Howdy!<br>
<br>
I have forked the gist and added the (current) iOS proposal to it:<br>
<a href="https://gist.github.com/4546737" target="_blank">https://gist.github.com/4546737</a><br>
<span class="HOEnZb"><font color="#888888"><br>
-M<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Jan 16, 2013 at 12:46 PM, Matthias Wessendorf <<a href="mailto:matzew@apache.org">matzew@apache.org</a>> wrote:<br>
> Hello,<br>
><br>
> a few quick/simple q's:<br>
><br>
> JavaScript<br>
><br>
> One question on the two gists...<br>
><br>
> Kris' gist uses pipe.next() of scrolling forward, Summer's comparison gist<br>
> uses pipe.read(page:"next") for the JS.<br>
><br>
> I think I do like the 'plain' read overload in JS... - but having a more<br>
> explicit next() (and others) is not that bad; but (currently) my vote would<br>
> be pipe.read(page:"prev"......<br>
><br>
> Oh... What happens when I have a regular pipe, object (where the paged<br>
> setting is NOT specified on its ctor), and I invoke pipe.read(page:"next") ?<br>
> I hope it does not issue a JS/type error :-) but I'd expect to have a<br>
> straight read of ALL the "objects" (or "entities")...<br>
><br>
> Android<br>
><br>
> You have the following:<br>
><br>
> cars.readWithFilter(filter, new Callback<Car>() {<br>
> @Override<br>
> void onSuccess(List<Car> data) {<br>
> firstPage = data;<br>
> }<br>
><br>
> @Override<br>
> void onError(Exception ex) {<br>
> //handle error<br>
> }<br>
> });<br>
><br>
><br>
> firstPage.next(.......);<br>
><br>
> I am wondering what is the fristPage here (since the data on the onSuccess<br>
> has been assigned to it)<br>
><br>
> Change Offset and Limit<br>
><br>
> I like both (JS and Android) :) The Android solution is similar to what I<br>
> had in mind for iOS...<br>
><br>
> I will update the comparison gist soon !<br>
><br>
> -Matthias<br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Jan 15, 2013 at 11:00 PM, Summers Pittman <<a href="mailto:supittma@redhat.com">supittma@redhat.com</a>><br>
> wrote:<br>
>><br>
>> On 01/15/2013 02:51 PM, Douglas Campos wrote:<br>
>><br>
>> As we wrap the day one of API design discussions, what about summarize the<br>
>> API proposals with usage?<br>
>><br>
>> JS/iOS/Android:<br>
>><br>
>> 1) usage example, covering some mentioned usecases like changing the<br>
>> paging "midflight" - something really straight to the point (no fluff, just<br>
>> stuff)<br>
>><br>
>> I forked Kris's gist and added android stuff using my proposal (sans<br>
>> blocking methods)<br>
>> <a href="https://gist.github.com/4542125" target="_blank">https://gist.github.com/4542125</a><br>
>><br>
>> I went for pedantic in a couple of examples...<br>
>><br>
>><br>
>> 2) API definition<br>
>><br>
>> I think this will give the orthogonal view we need to come to a decision.<br>
>><br>
>> kris: What about you providing a snippet of the API you hate too? just for<br>
>> comparison sake :P<br>
>><br>
>> -- qmx<br>
>> _______________________________________________<br>
>> aerogear-dev mailing list<br>
>> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> aerogear-dev mailing list<br>
>> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Matthias Wessendorf<br>
><br>
> blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
> sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
> twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
<br>
<br>
<br>
--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br></div></div>