Hello Brendan,
> So given product A and product B, I need to model a relationship or "link"
> between A and B. My first impression was that the "link" was a dependant
> object. So if I create A and "link" to B, the the "link" is a dependant
> object of A. This implies that A is responsible for the "link" (i.e. it's
> creation, deletion etc etc) so that if A is removed, so too is the "link".
> But what happens in the event that B is removed? Surely the "link" from A
to
> B should also be removed, since it's not longer valid? But B can't remove
> the "link", because the "link" was made by A...it would have to ask A to
> remove it, and since there's potentially a lot of "A"s linking to B, this
> could mean a lot of overhead.
I would suggest a separate Session Bean called RelationshipService or
ProductRelationService. It could have an interface like that
public interface ProductRelationService ... {
public addRelation(ProductPK p1, ProductPK p2);
// returns collections of PKs
public Collection getRelationsOf(ProductPK p);
public void removeRelationsOf(ProductPK p);
public void removeRelation(ProductPK p1, ProductPK p2);
...
}
regards,
--
[EMAIL PROTECTED]
MATHEMA Software GmbH
N�gelsbachstra�e 25 b
91052 E r l a n g e n
D e u t s c h l a n d
Tel +49(0)9131/8903-0
Fax +49(0)9131/8903-55
http://www.mathema.de
===========================================================================
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".