I am working in .Net, but that should not matter. In my model, an Address must have a parent Customer, but may or may not be related to a Contact. The primary relationship is between Customer and Addresses. But, I want to be able to relate other objects in my model to an address. So, in the example I described, I may want a Contact to be associated to an Address, or some other object to be associated with an Address. These other objects may hold a reference to an Address, but if I delete a Contact for example, the Address would not be deleted. An address can only be deleted directly, or if the parent Customer is deleted.
So...
- An address is always associated with the parent Customer through a Customer property.
- An address may be associated with zero or more "other" objects, such as a Contact or another TBD object.
I am not worried about navigating from an Address to one of these other objects, just the other way around.
So, my problem is how to automatically manage the references to an Address in these other objects when the Address is deleted.
OR...
Maybe I should manage this relationship from the Address side of things. For example, an Address may have zero or more contacts associated with it. Maybe I need to simply map a one-to-many association from Address to Contact and a many-to-one association from Contact to Address. This turns around my original thinking, but it seems right.
Any more thoughts?
Kevin
[/list]
|