<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 25 Sep 2012, at 15:00, Sanne Grinovero &lt;<a href="mailto:sanne@infinispan.org">sanne@infinispan.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On 25 September 2012 12:11, Marko Lukša &lt;<a href="mailto:marko.luksa@gmail.com">marko.luksa@gmail.com</a>&gt; wrote:<br><blockquote type="cite">On 25.9.2012 11:51, Sanne Grinovero wrote:<br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Any comments / other ideas?<br><br>Marko<br></blockquote>That's a lot of changes needed. One would say we could deprecate all<br>methods and rewrite the new ones, but wouldn't it be better to<br>deprecate the interface and introduce a brand new one?<br>What about "ResultsIterator" ? after all, we're not iterating on queries..<br></blockquote>I agree. The only thing that bothers me is that CacheQuery would then<br>need new methods called (lazy)resultIterator() (instead of iterator(),<br>which already exists).<br></blockquote>Right. though I like "resultIterator()" more so we're having luck in<br>this case ;)<br><br>Any better suggestion for names? Anyone thinks it's worth to remove<br>the old ones without a deprecation step to reuse the old names?<br><br></blockquote>One thing to keep in mind is that CacheQuery extends Iterable, therefore<br>a lot of users will actually implicitly invoke the iterator() method.<br>This pretty much means we should not introduce resultIterator().<br></blockquote><br>Looks like we have to break backwards compatibility. From the look of<br>how this API was, I guess not many users dealt with it before you, so<br>I'm fine with that, I don't see how else we can fix this API.<br><br>While at it, it would be nice to see if we can change the signature<br>from "extends Iterable&lt;Object&gt;" to return an iterator on the types<br>compatible with the values of the cache, since the Cache supports<br>proper generics.<br><br>To deal safely with Iterable, I think it would be better to default to<br>lazy loading mode and to provide an overloaded method which allows to<br>specify a loading mode.<br><br>Anyone having a better idea which allows to not break backwards compatibility?<br></blockquote><div><br></div><div>Not really - I think compatibility will break, sadly. &nbsp;:/</div><div><br></div><div>One option to maintain compatibility is to keep the existing QueryIterator and mark it as deprecated, and write a new iterator, maybe call it a ResultIterator (which is more accurate anyway!).</div><div><br></div><div>--</div></div><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div><div><br></div><div><div>Platform Architect, JBoss Data Grid</div><div><a href="http://red.ht/data-grid">http://red.ht/data-grid</a></div></div></div></span></div></span></div></span>
</div>
<br></body></html>