Page 59 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 59

Unit 5: Advanced Class Modelling – II




                                                                                                Notes
                           Figure 5.2: A  Subset Constraint between  Associations













              Task       Why do we draw a dotted arrow between classes or associations? Discuss.


          Self Assessment

          Fill in the blanks:
          4.   A ....................... is a functional relationship between modeling constructs such as classes,
               attributes, and associations.

          5.   A constraint restricts the values of .......................
          6.   The ....................... of a constraint should clearly indicate the affected data.
          7.   We often use ....................... to document the rationale for subtle modeling decisions and
               convey important enumerations.

          5.3 Derived Data

          Derived data is data that can be completely determined from other data. Classes, attributes, and
          associations can all be derived. The underlying data can, in turn, be base data or further derived.





             Notes Do not confuse our use of the term “derived” with the C++ derived class. A C++
            derived class refers to the subclass of a generalization; it has nothing to do with OMT’s
            meaning of derived data.

          As a rule, you should not show derived data during analysis unless the data appears in the
          problem description. During design you can add derived data to improve efficiency and ease
          implementation. During implementation you can compute derived data on demand from
          constituent data (lazy evaluation) or precompute and cache it (eager evaluation).

               !
             Caution Derived data that is precomputed must be marked as invalid or recomputed if
            constituent data is changed.
          The notation for derived data is a slash preceding the name of the attribute, class, association, or
          role.


                 Example: Figure 5.3 shows an example of a derived attribute for airline flightdescriptions.






                                           LOVELY PROFESSIONAL UNIVERSITY                                   53
   54   55   56   57   58   59   60   61   62   63   64