Re: CMR & remote interface blues

James Hicks <[email protected]>
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <000501c363c4$1fa3e380$739146cf@stimpy>
Do not rely on one piece of literature.  The EJB spec clearly states
that CMRs must use local interfaces.  Read section 10.3.2 of the EJB 2.0
spec before ranting.

James Hicks

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[email protected]] On Behalf Of Janne
Sent: Friday, August 15, 2003 5:03 AM
To: [email protected]
Subject: CMR & remote interface blues


I have just spent a while scratching my head on CMR & Local interfaces,
initially not knowing that CMR methods should use local interfaces.
Partly because WL6.1 works without complaining with CMR & remote
interfaces as long as they are 1:1....and partly because I'm sure that a
previous version of mastering EJB II (downloadable at theserverside) did
not mention local interfaces with CMR at all!

Now, I downloaded the PDF again and checked that there is a info box
about the subject (either a new one, or one that I missed previously).
It goes to
explain:

"A common theme throughout this book has been to always use local
interfaces when possible. This is especially true for entity beans, and
has a big impact on relationships.

Specifically, if you decide for some bizarre reason to use remote
interfaces with entity beans, then

- You must not expose get/set methods for relationship fields to remote
clients. Doing so creates problems because, for example, the client does
not have access to the container-implemented collection interface.

- Your entity bean can only have unidirectional relationships with other
entity beans. The lack of local interface prevents other entity beans
from having relationship with you. "

OK, the information may be there, but why not state it as clearly as
O'reilly's book for example:

"It is important to understand that although entity beans may have both
local and remote interfaces, a CMR field can use only the enity bean's
local interface when persisting a relationship."

Also, the fact that the examples contain methods that at least look
exactly like they would operate on remote interfaces

public abstract Order getOrder();
public abstract void setOrder(Order order);

is bound to confuse the reader.

Just had to rant.

========================================================================
===
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".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.