Hi,
Several people on this list have advocated the return of remote
relationships to EJB 2.0. I appreciate the utility of the concept, but
I also see a few possible problems with the concept as described
in PFD1. I was hoping that some advocates of remote relationships
might want to address these concerns. Also, I have a possible
solution to the "remote relationship" problem using PFD2, on which
I would appreciate feedback.
_Concerns_
1. Ideally, when an entity was removed it would also remove itself
from all the relationships in which it participated. However, a
remote entity could not be required to do this. (Consider that it
might execute on a different container or even belong to a different
organization.) So you are left with the choice that either entities do
not automatically remove themselves from relationships (this was
the choice in PFD1) or they have different semantics depending on
whether or not they are remote entities. Which is the correct
resolution?
2. A remote entity may be present in a relationship, but may not be
available for some reason. This reason may range from
communication difficulties with the remote container, to the prior
removal of that entity. How to deal with this lack of availability (and
the various causes) seems to me to be an application-level
question, and not a container-level question. How should the
container react when a remote entity in a relationship is not
available for instantiation?
3. The execution of queries on remote entities can not, in general,
be deferred to the persistent store--because that persistent store
may not be available to the container. (Again, for clarity consider
the case of an entity component in a different container, using a
different database, at a different organization.) This gives limited
utility to EJBQL for remote entities.
_Use of Proxy Pattern as Solution_
Of course, relationships may still be maintained with remote
entities using the structure provided by PFD2. There just needs to
be an application-level component. I'd like to suggest one solution:
use the proxy pattern for incorporating remote entity relationships
in an application. Specifically, use a local entity containing the
remote entity's primary key as a proxy for the remote entity. This
local entity can participate in relationships; can encapsulate the
retrieval of the remote entity; can indicate that the remote entity
has been removed or is not available; and can "cache" relevant
aspects of the remote entity for use in EJB QL queries (if
potentially unsynchronized data is an acceptable application risk
for that query).
I'd appreciate people's thoughts on either the problems of remote
relationships, or my suggestion of the proxy pattern as a solution.
-Dan
===========================================================================
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".