I am working on an easy document management system and looking for some help on how best to model certain relationships. In fact, I work with two "organizational units": Group and Type s. When a group and type are combined, they form a Link , to which Document then associated. Please note that a Group can be combined with more than one type, therefore, for example, you can have one Link consisting of "group 1" and "type A", and the second Link consisting of "group 1" and "group" , Type B '. In my opinion, this is not the best way to structure it, but at the moment I can not change it, so I need to do what they give me.
A Document may be a member of several Link s. For example, Document A may be a member of Link 10 and Link 13.
My problem is that sometimes I need to display one Document and a list of each Link to which the Document belongs, and in other cases I want to display one Link and list each Document that belongs to this Link .
I am not sure how to present the connection between these classes. I looked at the composite template, but I don’t think this will work for me, because it seems that the child has only one parent, where in my case the child can have several parents. Any help would be greatly appreciated.
design c #
Andrew
source share