From: "Sean Legassick" <[EMAIL PROTECTED]>
Subject: Re: [PROPOSAL] switch Peers to use List.
> On Thu, Feb 08, 2001 at 07:35:23AM -0500, Scott Tavares wrote:
> > but... now that I think about it, if you returned the List interface you
> > could do this just as easily:
> >
> > Iterator myIterator = MyPeer.doSelect(crit).iterator();
> > while(myIterator.hasNext())
> > {
> > ... doSomthing()
> > }
> >
> > Just thinking out loud...
>
> And you can't find out things like the size of the collection easily
> from an Iterator... a List is definitely the correct return type.
>
I agree, another benefit of getting the List interface is if you for some
reason you need to iterate the list more than once you will not need to go
through the "doSelect" method to get another Iterator thus reducing the
number of hits on the DB.
-Scott-
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]