Joined: Mon Jun 20, 2005 10:22 am Posts: 2
|
When you have a many-to-many relationship, say Artist-to-Genre and you designate one as Inverse=True is there a standard pattern for implementing a DB Facade to save the 'weak' end of the relationship?
FOR INSTANCE:
2 Classes: Artist and Genre have a many-to-many
Genre is Inverse=false
Artist is Inverse=True
The DBFacade is MusicRepository. It has a method called SaveArtist(Artist anArtist);
Should I make the Artist class keep a collection of Genres that the user 'removed' so that the SaveArtist method can loop over them and remove the Artist from the Genres and then persist the Genres?
Is there a pattern I should be following for this simple situation? I would like to hide the details of which end of the relationship is 'weak' from the user of my assembly.
Any suggestions would be appreciated.
Thanks.
|
|