Database Reference
In-Depth Information
assigned
to
EMPLOYEE
PROJECT
*
*
One employee is assigned to many projects.
One project has many employees.
A
Joe
B
Jane
C
D
Mary
E
F
Dave
Figure 6-10
Relationship cardinality: many-to-many.
Go over the association indicated between instances of the two objects. Look at
the associations from the EMPLOYEE side. Employee Joe is assigned to projects
A, B, and D. That is, one instance of EMPLOYEE is related to many instances of
PROJECT. Now, observe the associations from the PROJECT side. Project B is
associated with Joe and Jane. This means one instance of PROJECT is related to
many instances of EMPLOYEE. Note the asterisks placed at both ends of the rela-
tionship line to indicate this many-to-many relationship.
Minimum and Maximum Cardinalities Go back and look at the cardinality
indicators such as 1 or * placed on the relationship lines in the model diagram.
Analyze the meaning of these indicators. What do they indicate? These indicators
tell us about the number of instances of an object that can be related. Related to
how many instances of the other object? Let us review the meanings from the above
figures.
Figure 6-8: “1” placed closer to object INVOICE Indicates that a maximum of
one instance of the object INVOICE can be related to one instance of the
other object PAYMENT.
Figure 6-9: “*” placed closer to object ORDER Indicates that a maximum of
many instances of the object ORDER can be related to one instance of the
other object CUSTOMER.
Figure 6-10: “*” placed closer to object EMPLOYEE Indicates that a maximum
of many instances of the object EMPLOYEE can be related to one instance
of the other object PROJECT.
At this point, you realize that the cardinality indicators we have used so far really
indicate the maximum cardinalities. Is there something known as a minimum car-
Search WWH ::




Custom Search