Page 52 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 52
Object Oriented Analysis and Design
Notes Ternary associations occasionally occur, but we have rarely encountered an association of higher
degree. Ternary association is an association among three classes. On the same line, n-ary
association is an association among n classes.
The OMT symbol for ternary and n-ary associations is a diamond with lines connecting to
related classes as shown in Figure 4.10.
!
Caution An n-ary associations cannot be sub-divided into binary associations without
losing information.
Figure 4.10: OMT Symbol for Ternary and N-ary Associations
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
Example: Now let us consider the example of a ternary association. Programmers develop
Projects in (programming) Languages. One programmer can be engaged in zero, one or more
projects and can know zero, one or languages. Similarly, one project can be developed by one or
more programmers and in one or more languages. So this association along with its multiplicity
is shown in Figure 4.11.
Other examples of ternary and n-ary associations are “Teacher teaches Students in a Classroom”,
“Doctor diagnoses Patient in Room at a given Schedule” etc.
Figure 4.11: Example of Ternary Association
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
Notes A name for the association is optional and is written next to the diamond.
46 LOVELY PROFESSIONAL UNIVERSITY