Introduction to Rational Rose 98i Module 5: Sequence Diagram
Objectives:  Sequence Diagram <ul><li>You will be able to: </li></ul><ul><ul><li>Create a sequence diagram  </li></ul></ul...
Creating a Sequence Diagram
Sequence Diagram Toolbar Text Selection Tool Note Note Anchor Object Message Reflexive Message
Representing Objects Actor Object only Class  only Object and Class
Assigning Objects to Classes <ul><li>A new class can be created for the object </li></ul><ul><li>An object can be assigned...
Relocating New Classes
Messages
Inserting Messages New   message
Moving Messages
Reflexive Messages
Focus of Control
Message Deletion and Focus of Control <ul><li>All messages within a focus of control are deleted when the message starting...
Nested Focus of Control
Sequence Diagram with a Script
Collaboration Diagram
Exercise:  Sequence Diagram
Exercise:  Collaboration Diagram
Upcoming SlideShare
Loading in …5
×

05sequence

524 views
411 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
524
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • 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.
  • 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.
  • 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.
  • 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 &lt;New&gt; 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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
  • 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.
  • Hint: This is the Create a Schedule sequence diagram attached to the Register for Courses use case. Notes are discussed in the Introduction lesson.
  • Hint: Create the collaboration diagram from the sequence diagram by pressing the F5 button. Move objects and messages as needed.
  • 05sequence

    1. 1. Introduction to Rational Rose 98i Module 5: Sequence Diagram
    2. 2. Objectives: Sequence Diagram <ul><li>You will be able to: </li></ul><ul><ul><li>Create a sequence diagram </li></ul></ul><ul><ul><li>Assign objects in sequence diagrams to classes </li></ul></ul><ul><ul><li>Map messages to operations </li></ul></ul><ul><ul><li>Create scripts for sequence diagrams </li></ul></ul><ul><ul><li>Create a collaboration diagram from a sequence diagram </li></ul></ul>
    3. 3. Creating a Sequence Diagram
    4. 4. Sequence Diagram Toolbar Text Selection Tool Note Note Anchor Object Message Reflexive Message
    5. 5. Representing Objects Actor Object only Class only Object and Class
    6. 6. Assigning Objects to Classes <ul><li>A new class can be created for the object </li></ul><ul><li>An object can be assigned to a class already defined </li></ul>
    7. 7. Relocating New Classes
    8. 8. Messages
    9. 9. Inserting Messages New message
    10. 10. Moving Messages
    11. 11. Reflexive Messages
    12. 12. Focus of Control
    13. 13. Message Deletion and Focus of Control <ul><li>All messages within a focus of control are deleted when the message starting the focus is deleted </li></ul>
    14. 14. Nested Focus of Control
    15. 15. Sequence Diagram with a Script
    16. 16. Collaboration Diagram
    17. 17. Exercise: Sequence Diagram
    18. 18. Exercise: Collaboration Diagram

    ×