Alexandre Lefebvre wrote:

> Hi:
>
> Let say that you have a "customer" objects with a lots fields/attributes
> (name, address, phone, ....) that you have implemented as entity bean. In
> order to display all this attributes on the client GUI, you can do two
> things:
>
>         1. Call the get methods (getName, getAddress,...) one after another. I
> think each of these calls are a remote call. Therefore, to just show a
> "customer", one must perform a lots of remote calls that are very expensive
> (compared to local calls).
>         2. Have "customer" bean to return the all the attributes at once as an
> object to the client. That is, "customer" bean has a get() method that
> returns a object containing all the attributes (using C/C++ lingo, a
> structure). This way, the client is making one remote call, and a lots of
> local calls. If the object (structure) returned by the get() method of
> "customer" is implementing serializable interface, does the client get a
> copy of the object or just a reference to it? Where is the returned object
> resides, client or the EJB container?
>

Due to the complexity of having to specify yet another object (first remote i/f,
home i/f, Entity, and now a container for the fields) I would use something more
dynamic, like a HashTable or a Dictionary, to store the fields.

Nevertheless, I have not tried this solution, neither the next one yet.

>
> Is there any better way to avoid a lots of remote calls?
>

What people is considering is having a session bean that construct a structured
document out of the bean, containng information and presentation logic, and
returns such a document to the client. The client then processes this document at
will.

>
> Thanks,
> Ramin Javanbakht
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> 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 "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to