Ah, this sounds perfect indeed to go!! As Emmanuel mentioned, "Cursor already 
implements Iterable".

-----Original Message-----
From: Stefan Seelmann [mailto:[email protected]] 
Sent: Monday, July 06, 2015 2:42 PM
To: [email protected]
Subject: Re: How to implement getIdentities(int start, int limit) more 
effectively

On 07/06/2015 08:33 AM, Xu, Yaning wrote:
> Thanks for Kai and Emmanuel's good discussion. 
> 
>>> ... keep it simple and use List<String> getIdentiies() at the moment.
> 
> This sounds good to me to proceed. Thanks!

Just a suggestion: Use java.lang.Iterable<String> (not Iterator) as return 
type. For the first implementation you can still return a List<String> as 
java.util.List implements this interface. But you don't expose any 
implementation detail. Later you can change the actual return type to something 
more sophisticated and even extend the return type without breaking the 
interface.

Kind Regards,
Stefan

Reply via email to