I am still trying to get my head around
EJB.
I understand that having both a local and remote interface is rare. I have heard others on this site say that they could not imagine a reason for having both.
Supposing there are two entity beans and they have a bi directional CMR. Each bean would have to have a local interface for the other to access it through. Of course, at least one of the beans will need a remote interface for clients to access it through. So it seems that at least in this case having both interfaces would be required.
So what's the story? Are bi directional CMRs rare?
Why do you soppose the designers of EJB made it so that entity beans in a CMR must use local interfaces to access each other?
What would happen if I wrote an accessor that was part of a CMR to lookup and return the remote interface? i.e. AccountBean and TransactionBean have a CMR. Suppose in AccountBean.getTransaction() I lookup the remote home for TransactionBean and call findByPrimaryKey on it, returning the results to the client. What would happen? Could I do this without declaring a CMR? If so why have CMRs?