Tom Jordan wrote:
> Hi
>
> I often need to iterate through a Collection and was wondering if its better
> to return the collection the client, which is by default serializable or
> would it make more sense to wrap the collection such that you can iterate
> through it remotely? I would like to know what experiences people have had
> with either or another approach that might be preferable. Any pros or cons
> to either approach?
>
Of course it always depends on the amount of data you want to
send over the wire and the number of cuncurrent clients you expect but one
thing you might consider (especially for large read-only collections) is
implementing a stateful sessionbean holding (or fetching on demand) the data,
implementing a "nextN(int)" method. if you hide that on the client side with a
buffered iterator, you might get the best of both worlds. your client app sees
only a simple iterator and calls "next()" and you can adjust the number of
network roundtrips via the buffer size. It's just a little more effort but
gives you some flexibility. In many cases a moderate buffer size will give you
good enough performance, your client side programming looks neat and you don't
have to fetch all the data in one go (not knowing how much is coming). It's all
a tradeoff and may not help in all cases but I've applied it succesfully in
some.
Robert
--
(-) Robert Kr�ger
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".