Skip to content

Complex Relationships

wundram edited this page Dec 21, 2014 · 1 revision

How do complex relationships work?

Complex relaltionships consist of a query to select 0 - n objects on at least one end. If they have a simple end, then it can be stored it object the simple end refers to. If both ends are complex, they will have to be stored at the product level (or globally if the relationship crosses projects).

How do we reverse complex relationships? If we cache the results of the query at the end of a relationship, it is only good until something changes. Do you have to test every relationship in a produce to see if one matches the object you are looking at? How many of these are we likely to have?

Using branch objects, (objects that represent a branch of a version tree, like 1.2.*), gives us a good shortcut for a lot of cases. We can probably index the branch objects, so we can quickly see if our version object is in any of them, and making a relationship to a branch object is a single to single relationship. Like

version 7.6 of exe ---depends on--> branch 1.* of lib --contains--> 1.2,1.3,1.4,1.5,1.6

Do we allow only simple->complex, or complex->complex?

I don't see that the mechanism for a complex->complex relationships is any different. The real problem is going to be minimizing the number of query expressions we have to test against just to determine what relationships a particular object is in.