Good question Tom.
This kind of scenario happens alot. It really boils down to what the
intention is at the client. I've tried both. As Jim Richards said - for
remote clients using the returned enumeration requires a network call each
time you iterate. Downside with returning a whole collection is the
serialisation time etc.
You may only want to show a list of object names in a scrolling list
somewhere. Then allow the user to pick from the list. Eg. you want a very
little information about a lot of objects and possibly a lot of information
about one or two objects. Assuming you can cache information on your
client, I'd be tempted to send just the primary keys and a pertinent strings
wrapped in a collection, then do a findByPrimaryKey when the particular
object from the list is selected.
Cheers,
Jon
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
"The art of living is to experience more and to want less."
-----Original Message-----
From: Tom Jordan [mailto:[EMAIL PROTECTED]]
Sent: Sunday, October 24, 1999 7:37 PM
To: [EMAIL PROTECTED]
Subject: Returning Collections - Serializing vs RemoteObject?
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?
Along the same lines finder methods of entity beans return enumerations. I
have read in the archieves of this list that holding that storing this enum
has a negative impact on the server in terms of resource consumption. Is
this true? In a situation where a finder method return 50-100 records, I
might not want to send all of them to the client. Would it not be
reasonable to store the enum in a session object, get the block of records
you want and return those as a small collection (remotely or serializing
what ever is the recommendation from above). Is there a better way to
handle this?
Thanks in advance.
Regards
Tom
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
===========================================================================
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".
===========================================================================
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".