-----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".

Reply via email to