Interaction Diagrams
Last updated: May 24, 2006
Objectives:
Define classes and their characteristics
Define the two types of interaction diagrams and their importance to realizing use cases identified in the use-case model
Identify the inputs and elements necessary to create the interaction diagrams
Use the Rose tool to add classes and their characteristics to the model
Create interaction diagrams to show the interaction between objects
Class Responsibilities:
Responsibilities are listed in the operation compartment, but are prefixed by // before the responsibility name. This notation is removed when the operation is defined.
Add Analysis Classes:
Add Classes to the Browser:
Define Class Responsibilities:
Double-click the class in the browser to open its Specification window
Click the Operations tab -> Right-click the white window -> Click Insert -> Type the responsibility name over opname
Remember to add (//) to indicate a responsibility
Repeat above steps to add responsibilities for the remaining classes
Interaction Diagrams:
Interaction diagrams are modeled in the Logical View under the appropriate use-case realization
In Rose, you can activate Sequence numbering from the Options window. It is not a default because the location of the arrows show the relative sequence of events
In sequence diagrams, actors who initiate an action generally appear on the left side. Passive actors appear to the right side of the diagram
The focus of control is set up from the Diagram tab in the Options window. It is a default in Rational Rose. If you don't want the focus of control to display on your sequence diagrams, go to the Options window to turn off the feature.
In Rose, collaboration numbering is activated (a default). We recommend leaving the numbering on, since collaboration diagrams are not time ordered.
Create a Sequence Diagram:
Add Sequence Diagram to the Browser
Open Lab6_1.mdl
Add the Maintain Personal Planner sequence diagram under its use-case realization in the browser -> Open the diagram
Name the diagram after its use case followed by the type of flow
Add Actor and classes:
Find Actors from the Use-Case Model and Analysis Classes from the Analysis Model
Drag these elements from the browser into the diagram window
Add Object Messages:
Click the Object Message icon in the diagram toolbar. -> Drag the mouse from the lifeline of the sending object to the lifeline of the receiving object.
For the message to self: Click the Message to self icon -> Click on the sending object's lifeline
if the Focus of Control is on, notice the varying lengths
Add Responsibilities to Object Messages:
Right-click the object message -> Click the responsibility from the list of existing responsibilities
Add the note and the anchor
Show Unresolved Objects:
An unresolved object is any object that does not have a class specified
The Show Unresolved Objects report lists all unresolved objects in an Interaction Diagram
Show Unresolved Messages:
An unresolved message indicates that an object does not have an operation assigned to it
The Show Unresolved Messages report lists all unresolved messages in an Interaction Diagram
Documentation Report:
You can generate this report for any Rose diagram created in either the Logical or Component View
This report generates a formatted Microsoft Word document of the logical or Component View of a selection
The Documentation Report generates a data dictionary from a model using Microsoft Word OLE Automation objects
Auto Generate a Communication Diagram:
Auto Generate the communication Diagram:
Open Lab6.1_mdl -> Open the sequence diagram
Press F5 to auto generate the communication diagram
You'll have to arrange the diagram elements.
Notice the communication diagram is added to the browser
You may resize the diagram elements: Format -> Click Automatic Resize or Autosize All
Technically, there is less-diagram cleanup when you generate a sequence diagram from a communication diagram
Run Reports:
Report -> Click each of the reports
Try These Activities:
Delete one of the responsibilities from the object message
-> Run Show Unresolved Messages report
From the diagram toolbar, add an object to the diagram and name it George -> Run Show Unresolved Objects report
Add a note that links the sequence diagram to the communication diagram
Open the communication diagram
Click the Note icon in the diagram toolbar and add it to the diagram
From the browser, drag the sequence diagram into the note
Double-click the note
VOPC Class Diagrams:
A VOPC class diagram shows a use-case realization's participating classes and the relationships among those classes
It shows all classes whose instances collaborate to perform the use case and their relationships
It ensures consistency in use-case implementation across subsystem boundaries
Like interaction diagrams, there is one class diagram associated with each flow through a use case. It's just a shift in focus. You'll now concentrate on classes and their relationships, not objects and their relationships
Interaction diagrams represent the dynamic view of the system, and class diagrams represent the static view
Do not include actors on your class diagrams. They exist outside the system, and you are modeling the system itself
They are modeled in the Logical View and show the static view of the system
Role Names:
Role names preferable to association names when sufficient information is available
Role names should always be used during design
Note that Rational Rose automatically places a symbol next to the role name to indicate how the class and its elements are seen outside the package where the class is defined. Examples are public (+), private (-), protected (#), and implementation (no symbol).
Show Access Violations:
An access violation occurs when a class in one package references a class in another package in the absence of an import relationship between the two packages. The following represent Export Control values in Rose (Association Specification window)
Public: The element is visible outside of the enclosing package and you can import it to other portions of your model. Operations are accessible to all clients
Protected: The element is visible to any of its descendants
Private: The element is visible only to itself or elements nested within it
Implementation: The element is visible only in the package in which it is defined. An operation is part of the implementation of the class
An access violation also occurs when a package references a class from another package, whose export control is set to Implementation
The Show Access Violations report lists all access violations between packages in a class diagram
Show Instances:
The Show Instances report lists all the interaction diagrams where instances of the class appear
Create a Class Diagram:
Add Class Diagram to the Browser:
Open Lab7_1.mdl
Add the Maintain Personal Planner class diagram under its use-case realization in the browser -> Open the diagram
Add Classes to the Diagram:
View the Maintain Personal Planner's communication diagram to determine the classes to add to the class diagram
Drag the design classes from the browser into the diagram window
Add Associations:
Use the communication diagram to determine the relationships between classes
From the diagram toolbar in the class diagram: Click the Unidirectional Association icon -> Drag the mouse from the sending class to the receiving class
Add Role Names and Multiplicity:
Double-click the association to open the Association Specification Window
From the General tab: Type Current Profile in the Role A field -> Click the Role A Detail tab to add Role A's multiplicity
From the Multiplicity list, click 0..1
Click the Role B Detail to add Role B's multiplicity
-> From the Multiplicity list, click 0..1
Try adding multiplicity between the boundary and control classes