|
Visual Modeling with Rational Rose 2002 and UML Authors: Quatrani T. Published year: 2002 Pages: 64-66/134 |
| I l @ ve RuBoard |
Reflexive RelationshipsMultiple objects belonging to the same class may have to communicate with one another. This is shown on the class diagram as a reflexive association or aggregation. Role names rather than association names typically are used for reflexive relationships. CREATING A REFLEXIVE RELATIONSHIP IN RATIONAL ROSE
A reflexive relationship is shown in Figure 6-8. Figure 6-8. Reflexive Relationship
The reflexive relationship in Figure 6-8 may be read in the following ways:
|
| I l @ ve RuBoard |
| I l @ ve RuBoard |
Finding RelationshipsScenarios are examined to determine if a relationship should exist between two classes. Messages between objects mean that the objects must communicate with each other. Associations and/or aggregations provide the pathway for communication. Relationships may also be discovered based on the signature of an operation. This is discussed in Chapter 7. Relationships in the ESU Course Registration ProblemIn the Add a Course Offering scenario, the communicating objects along with the relationship-type decisions that have been made are shown in Table 6-1. Table 6-1. Class Relationships
A class diagram with the added relationships is shown in Figure 6-9. Figure 6-9. Relationships in the Add a Course Offering Scenario
|
| I l @ ve RuBoard |
| I l @ ve RuBoard |
Package RelationshipsPackage relationships are also added to the model. The type of relationship is a dependency relationship, shown as a dashed arrow to the dependent package, as shown in Figure 6-10. If package A is dependent on package B this implies that one or more classes in package A initiates communication with one or more public classes in package B. Package A is referred to as the Client package and package B is referred to as the Supplier package. Package relationships are also discovered by examining the scenarios and class relationships for the system under development. As this is an iterative process, the relationships will change as analysis and design progresses. Figure 6-10. Package Relationships
Package Relationships in the ESU Course Registration ProblemIn the Add a Course Offering scenario, the AddACourseOffering class sends a message to the ProfessorCourseManager class. This implies that there is a relationship between the Interfaces package and the UniversityArtifacts package. At this time, we have not discovered any relationships to the People package. CREATING PACKAGE RELATIONSHIPS IN RATIONAL ROSE
The package relationships for the Course Registration System are shown in Figure 6-11. Figure 6-11. Package Relationships in the ESU Course Registration System
|
| I l @ ve RuBoard |
|
Visual Modeling with Rational Rose 2002 and UML Authors: Quatrani T. Published year: 2002 Pages: 64-66/134 |