> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Benjamin Broll
> ProjectBean
> - - getContents() returns Collection
> - - addContent(Content content) returns void
> - - removeContent(Content content) returns void
>
> ContentBean
> - - getProject() returns Project
> - - setProject(Project project) returns void
This is probably the most straightforward way to implement a bidirectional
relationship with BMP.
> Now since those mthods mainly perform the same thing, I'm not sure
> whether I should approach the implementation like that. Do you guys
> think I should just go along, or maybe clean things up and leave
> either the add/removeContent methods of the ProjectBean or the
> setProject method of the ContentBean?
Not sure what you mean. If you do this, your relationship becomes unidirectional,
right? Or are you talking about implementing a private finder on the other side
of the relationship to restablish its bidirectionality? (in which case I would
still vote for your initial design).
> As a second (minor) question I'd like to ask, whether there is a
> general guideline when to have the remote interface of a bean as the
> method parameter or the primary key. Any insight on this would be
> great as well ...
It's all a matter of trade-off. Sending the remote object might save you a
lookup() on the receiving side, but you might lose some extra support that the
container would provide for you (like replication or load balancing).
--
Cedric
===========================================================================
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".