I'd be grateful for a few opinions on how to model the following:
I have an e-commerce engine which is just a regular shopping-cart type
application. I have an entity called Product (containing the usual info)
which I'm modelling as an entity bean. The application supports the concept
of related products, where one product can be linked to another product
which is similar to the first one.
(In database terms, I have a Product table and a RelatedProduct table, where
the RelatedProduct table contains two columns, each of which is a product
id)
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.
Any ideas of this one, is it better to model the "link" as an entity in
itself? Even though it's closely coupled to the product?
Thanks in advance
Brendan
======================================
Brendan Stewart
Kadius
Unit 19a, Rosemount Park Drive
Rosemount Business Park
Ballycoolin Road, Dublin 11
Phone: +353 1 885 0306
Fax: +353 1 821 1102
Email: [EMAIL PROTECTED]
Web: http://www.kadius.com
======================================
===========================================================================
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".