Pretend that you are not using entity beans at all (the goal of a facade
after all!-) Consider that to make the system efficient you want to
minimize the number of network roundtrips. What data does the client
program use? What does the interface look like?
One possibility if you're displaying some type of tree of data, is that you
could fetch one node at a time, and that along with each node you would
fetch summary information about all it's children. This should mean that
one click on the client causes one network roundtrip.
Cheers
Jay Walters
-----Original Message-----
From: Heiko Gottschling [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 11:47 AM
To: [EMAIL PROTECTED]
Subject: Re: Session beans as Facade to entity beans
Hi,
> In the entity bean you have the data logic, in the session bean you have
> the business logic. You use the session bean to interact with the user.
> An example:
>
> SB: CourseEnrollment
> EB: Student, Enrollment, Course
>
> SessionBean have following methods:
> * enroll(studentId, courseId)
I understand this, but this does not answer my question :-)
The problem is this: even if the session bean contains the business logic
and
thereby changes the data, the client sometimes needs to see the data (e.g.
in
order to present it to the user). Now, how does the data get from the entity
bean to the client? This could be done using bulk accessor objects (=value
objects), like this:
public class CustomerValue {
String fistName;
Date birthDate;
}
---
CustomerValueObject value = customerSession.getCustomerValue("some
Customer
ID");
However, if the entities to be dealt with are complex, this is not very
reasonable. Imagine an entity defined like this:
EntityA = {
EntityA parent; // this produces a tree-like structure
EntityB[] someEntitiesOfTypeB;
}
I cannot use value objects to model this kind of entity, because if I did I
would have to fill the 'someEntitiesOfTypeB' array as well as the 'parent'
reference, which in turn will have some references to its own
parent.someEntitiesOfTypeB and so on, which would yield a huge structure.
However, in most cases I do not at all need to access the whole hierarchy of
objects, so this is a gigantic waste of resources.
If I cannot use value objects to access the entities, how should I query my
data? For example, how could a client retrieve the someEntitiesOfTypeB
vector
of a given entity?
thx
Heiko
===========================================================================
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".