I would like to thank everyone for their help. I just ask a followup
question and recap on what has been said thus far.
The times I need to use collections is any one of the following situations:
- Return a small list (typically to present the user with drop down,etc)
- Present the user with a larger list, from which they might pick 1 or 2 to
work with.
In the first situation, from what I have read so far, it makes most to sense
to return a serialized collection, array,etc.
In the second approach, it might make sense enhance the above, by creating
a session bean that can act as a buffer for returning a group of records -
essentially you send back a smaller collection. However, to build up the
small collection, you still resort to the above method of taking the enum
and iterating through it in the session bean to build up a collection. If
you are using entity beans, than you would endup making a database hit for
each object -right?
As an alternative, I have seen in Valto's Ejipt offering a few collection
classes which are really the Map and Tree collections wrapped with
EJBObject. Is there a benefit of using this approach versus the returning
of a serialized approach from above.
Thanks a lot the excellent help.
Tom
>From: [EMAIL PROTECTED]
>Reply-To: A mailing list for Enterprise JavaBeans development
><[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Returning Collections - Serializing vs RemoteObject?
>Date: Mon, 25 Oct 1999 13:53:54 GMT
>
>Jon Ferguson <[EMAIL PROTECTED]>@JAVA.SUN.COM> on 1999-10-25
>14:57:00
>
>Please respond to A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
>Sent by: A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
>
>To: [EMAIL PROTECTED]
>cc:
>
>Subject: Re: Returning Collections - Serializing vs RemoteObject?
>
>
>I would say that really depends on the application. To iterate from the
>client over an enumeration on the server will have a performance impact due
>to the network IF this is a concern. I always send the whole lot up to the
>client and handle it up there.
>
>It boils down to calling the server 10 times and serialize one object or
>calling one time and serializing 10 objects. Remember that half of the CPU
>for serializing is taken care of by the client. In 9 of 10 is the
>serializing of 10 objects to prefer. CPU is cheap but network and databases
>are usually the bottlenecks.
>
>
>
>Regards
>Erik
>---------------------------------------
>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".
>
>===========================================================================
>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".
>
______________________________________________________
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".