Page 35 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 35

Unit 3: Class Modelling




                                                                                                Notes
                                       Figure 3.4: Association
                                          Association name

                             Student                      University
                                           Registered in





                               Class                         Class

               !
             Caution Every association has roles.
          For example, in Figure 3.5 you can see that two classes, Student and University, have their
          defined roles. Here you can also see that binary association has two roles, one from each class.
                                    Figure 3.5: Roles in Association

                                               Role
                    Student                                   University

                                      Study          Teach

          Associations may be binary, ternary, or have higher order. In exercise, the vast majority of
          association is binary or ternary associations. But a ternary association is formed compulsion;
          they cannot be converted into binary association.



             Did u know? If a ternary association is decomposed in some other association, some
             information will be lost.



                 Example: In Figure 3.6 you can see a ternary association.
                                    Figure 3.6: Ternary  Association


                           Student                              Teacher




                                              Class





              Task       Make distinction between binary and ternary association.

          3.2.2  Multiplicity

          Multiplicity in an association specifies how many objects participate in a relationship. Multiplicity
          decides the number of related objects. Multiplicity is generally explained as “one” or “many,”
          but in general it is a subset of the non-negative integers.



                                           LOVELY PROFESSIONAL UNIVERSITY                                   29
   30   31   32   33   34   35   36   37   38   39   40