Hi,

I have a big doubt concerning the full EJB indepedency.

Say you have two entity beans, one called Person and one called Email. The former holds informations about a person (such as name, surname, birthdate, sex ...) and the latter a mail address (and maybe other attributes).

A solution to get a relationship between a Person and many Email is to declare a CMR between these two entities.

So Person will inherit two methods : setMails(Collection) and Collection getMails() which return or take Collection of Email entities.
On the other side, the methods Person getOwner() and setOwner(Person) will appear on the Email bean.


If I want to use the Person bean and the Email bean in a totally independent way, they should not contains these methods.
Each bean should be deployed separatly.


My question is : does the only solution is to alter beans and break independency ?

A solution is to create a third bean, say InternetUser, with a 1:1 relationship with the Person bean and 1:M relationship with the Email bean.
Is it possible to do so ?
Can Person bean and Email bean be blind of how they are used ? Or do I need to alter Person and Email so they know the InternetUser they belong to ?


Thanks for your advice,
Ionel



-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to