vendredi 6 février 2015

database structure for links between objects of same class


I have seen elsewhere that it is a nice design to implement links between objects in a database as a seperate object. This makes a clean way to have multiple objects of one class to be linked to an object of another class, as opposed to adding a "links" property to an object, which then gets populated with, say a csv list of other objects that are linked.


Now I want to go through my music collection (mp3) and find differently encoded versions of the same recording (via audio fingerprinting - think of the same song ripped twice with a different bitrate for example). Now I am not sure how to design the link objects, since they link objects of the same class. I could just do something like



id songA songB


but then if I want to search for all matches for a particular song, I will have to go through both songA and songB to find possible links. Is there a smarter way to do this?





Aucun commentaire:

Enregistrer un commentaire