Hi Benjamin.
I don´t think this is an issue anymore.
You must have methods enougth to never need an extra query.
For example, I can´t imagine a situation where setProject is useful:
tipically you can set the foreign key between the project object and its
content objects in create() time. Assuming that contents of a project cannot
be moved to another project then setProject will never be used ergo it
doesn´t exists.
Sorry if I made an trivial interpretation of your question.
Thanks.
----- Original Message -----
From: "Benjamin Broll" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 5:02 PM
Subject: Distribution of methods between EntityBeans
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I've got a question regarding EntityBeans.
>
> Let's say I have a bean named Project and a bean named Content. A
> relationship between both beans exists - a one-to-many relationship:
> one Project can have many Contents and one Content belongs only to a
> single Project.
>
> In the database this is represented by a foreign key of the
> Projects-table which the Contents-table holds. Now I'd like to have
> the following methods in the beans:
>
> ProjectBean
> - - getContents() returns Collection
> - - addContent(Content content) returns void
> - - removeContent(Content content) returns void
>
> ContentBean
> - - getProject() returns Project
> - - setProject(Project project) returns void
>
> 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? Please give me some insight to
> what you think.
>
> 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 ...
>
> Thanks for your answers in advance,
>
> .bbr
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
>
> iQA/AwUBOnbXmNmuaPShga5HEQLtbACfUZjIvj149VFierZtrnzIq4KDOf8AoNYQ
> 6kBHz6r3+gd8d9tJZaJ4EIMk
> =t4Y+
> -----END PGP SIGNATURE-----
>
>
===========================================================================
> 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".