Anzeige
Anzeige

Más contenido relacionado

Anzeige

05sequence

  1. Introduction to Rational Rose 98i Module 5: Sequence Diagram
  2. Creating a Sequence Diagram
  3. Sequence Diagram Toolbar Text Selection Tool Note Note Anchor Object Message Reflexive Message
  4. Representing Objects Actor Object only Class only Object and Class
  5. Relocating New Classes
  6. Messages
  7. Inserting Messages New message
  8. Moving Messages
  9. Reflexive Messages
  10. Focus of Control
  11. Nested Focus of Control
  12. Sequence Diagram with a Script
  13. Collaboration Diagram
  14. Exercise: Sequence Diagram
  15. Exercise: Collaboration Diagram

Hinweis der Redaktion

  1. To create a sequence diagram in the Browser Click right to select the “owning” package or use case in the Browser and make the pop up menu visible. Select the New:Sequence Diagram menu command. While the diagram is still selected, enter the name of the diagram. To open a sequence diagram Double click on the sequence diagram in the Browser. Explain that a sequence diagram may be created in either the use case view or the logical view. The diagram is “owned” by either a package or a use case. Our process and OOAD course have use case realizations in the logical view. For simplicity, this course just uses the use case view.
  2. To customize the sequence diagram toolbar Click right on the toolbar to make the pop up menu visible. Select the Customize menu command Click to select the button that you want to add or remove. Click the Add or Remove button to add or remove the button from the toolbar. Click the Close button to close the Customize Toolbar window.
  3. To add an actor to a sequence diagram Click to select the actor in the Browser. Drag the actor onto the diagram. To create a named object Click to select the object icon on the toolbar. Click on the sequence diagram to place the object. While the object is still selected, enter its name. To assign an object to a class Click to select the class in the Browser. Drag the class onto the object. To create an anonymous object (unnamed object assigned to a class) Click to select the object icon on the toolbar. Click on the sequence diagram to place the object. Follow the steps to assign an object to a class. Explain that there are different ways to represent objects in a sequence diagram. Object name only -- this is used many times in the beginning before all the classes have been discovered Class name only -- this is sometimes referred to as an anonymous object. This is very common. Object name and class name -- this is used if you need to communicate both the object name and the class name. It is very useful when two objects in the same class participate in the scenario.
  4. To assign an object to a class using the Specification Click right on the object on the diagram to make the popup menu visible. Select the Open Specification menu command. Click the arrow in the Class field to make the drop down menu visible. Select the desired class. Click the OK button to close the Specification. To create a new class using the Specification Click right on the object on the diagram to make the popup menu visible. Select the Open Specification menu command. Click the arrow in the Class field to make the drop down menu visible. Scroll until the value <New> is visible. Select this value to make the Class Specification visible. Enter the name of the new class. Click the OK button to close the class specification. Many times you will discover additional classes as you are creating sequence diagrams. These classes are those that are needed to realize the functionality specified in the scenario.
  5. To relocate a class Click to select the class in the Browser. Drag the class to the new location. If a class is created via the Object Specification, Rose will place the class in the view that the diagram belongs to. In other words, if the sequence diagram is in the use case view, the new class will be in the use case view. If this is the case, then the class should be relocated to the appropriate package in the Logical View.
  6. To create a message Click to select the message icon on the toolbar. Click on the line representing the client object (object sending the message). Drag the message to the line representing the supplier object (receiver of the message). While the message is still selected, type the name of the message. To set message numbering Select the Tools:Options menu command. Select the Diagram tab. Click the Sequence Diagram Numbering check box to toggle the selection (numbering on, numbering off). A message is an arrow that points from the client (sender) to the supplier (receiver). Message numbering is optional.
  7. To insert a message Click to select the message icon on the toolbar. Click at the insertion point on the line representing the client object. Drag the message line to the line representing the supplier object. While the message is still selected, type the name of the message. Messages may be inserted anywhere on a sequence diagram. Rose will automatically re-number the messages.
  8. To move a message Click to select the arrow representing the message to be moved. Drag the arrow to the new location. Messages may be moved by dragging the message to its new spot. Rose will automatically re-number the messages.
  9. To create a reflexive message Click to select the Message to Self icon on the toolbar. Click on the line representing the object. While the message is still selected, enter the name of the message. Objects may collaborate with themselves. This is show with a reflexive message.
  10. To set focus of control Select the Tools:Options menu command. Select the Diagram tab. Click the Focus of Control checkbox to toggle the selection. To change the focus of control for a message Click to select the message in the sequence diagram. Drag the message to the new focus of control. Note: To move a message to a new focus of control, the message arrow must be completely outside its existing focus of control. Focus of control represents the relative time that the flow of control is focused in an object. It represents the time an object is directing messages.
  11. To delete a focus of control Click to select the message that starts the focus of control. Select the Edit:Delete from Model menu command. Note: When you delete a focus of control, all messages that are initiated during the focus are deleted. If a message that starts a focus of control is deleted, ALL the messages contained within that focus of control are deleted.
  12. To turn on nested focus of control Select the Tools:Options menu command. Select the Diagram tab. Click to Hierarchical Messages checkbox to toggle the selection. A nested focus of control is a focus on control that resides on another focus of control. Nested focus of control allows you to distinguish exactly where a message starts and where it ends.
  13. To create a script Select the Text Box icon on the toolbar. Click on the diagram to place the text box. While the text box is still selected, enter the text of the script. Resize the text box as needed. To attach a script to a message Click to select the text. Depress the Shift key. Click to select the message. Select the Edit:Attach Script menu command. Note: If you move the message, the script will also be moved. A script is additional text that may be added to a sequence diagram. Some uses of scripts are to: Explain complicated steps Show iteration Show branching
  14. To create a collaboration diagram from a sequence diagram Open the sequence diagram. Press the F5 button. Move the objects as needed. Note: Pressing the F5 button will allow you to go between a sequence diagram and its corresponding collaboration diagram. Explain that a collaboration diagram is a different graphical view of the information in a sequence diagram.
  15. Hint: This is the Create a Schedule sequence diagram attached to the Register for Courses use case. Notes are discussed in the Introduction lesson.
  16. Hint: Create the collaboration diagram from the sequence diagram by pressing the F5 button. Move objects and messages as needed.
Anzeige