What happens when more than two classes are associated? Figure 2 shows four associated classes. A, C, and D each have one association, and B has three.
Figure 2: Several Associated Classes
Again, how many instances of each class should we generate with each generation? As in the previous example, assume cardinalities equal to maximum multiplicities. Then
How many values of each class should we generate with each generation? In particular, how many of B should we generate, since it participates in several associations? If we generate 3 values of B, then we're all set with A and D (we'd generate 2A and 5D). But we'd need 41/2 of C, which violates the integral number of values constraint. Similarly, if we generated just 2B, then C would be satisfied, but A and D would not. We need to find new values such that the original ratios are maintained, but an integral number of values are generated. For each end, we call this new value the size of the end, to distinguish it from the original cardinality.
We want to combine the three statements in the example into one, whose sizes give the number of values we need. To do this, we:
The number of instances at each end is just the size of that end: 4A, 6B, 9C, 10D.