Problem Analysis  «Prev  Next»

Modeling Associations - Exercise Result

You entered:

Course project: Modeling Advanced Associations

  1. Examine many-to-many associations. Ask "Is there information that we need about the links in this association?"
Examine many-to-many associations
Examine many-to-many associations
  1. Identify the information that you need to track. Sometimes it will be a single attribute. Sometimes it could be attributes and operations.

Identify the information you need
Identify the information you need
  • Place the information in a class definition.

  • Place the information in a class definition
    Place the information in a class definition
    1. Attach the new class to the association using a dashed line. This method shows how you arrived at the need for a new class, that is, it encapsulates everything you need to know about the relationship between objects in the association.

    Attach the new class
    Attach the new class
    1. In this case, the new association class also has a relationship with the CreditCard class, that is, zero or more Purchases debit each CreditCard.

    Relationship with the CreditCard class
    Relationship with the CreditCard class
    1. To implement the class, you might later need to promote it to the status of a regular class. To do so, replace the original association and dashed lines with two new associations. Draw an association from the association class to one of the original classes.

    Promote to status of regular class
    Promote to status of regular class
    1. Name the new association and define the multiplicity.

    Name the new association
    Name the new association
    1. Repeat the process for the association between the association class and the other original class.
    Repeat the process
    Repeat the process
    1. Delete the original association that has now been completely replaced.
    Delete the original association
    Delete the original association