Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sequence Diagrams And Collaboration Diagrams HungNM.

Similar presentations


Presentation on theme: "Sequence Diagrams And Collaboration Diagrams HungNM."— Presentation transcript:

1 Sequence Diagrams And Collaboration Diagrams HungNM

2 Sequence Diagram Toolbar

3 The Collaboration Diagram Toolbar

4 Working with Actors on an Interaction Diagram To create an actor object on an Interaction diagram:  1. Open the Interaction diagram.  2. Select the actor in the browser.  3 Drag the actor from the browser to the open diagram.

5 Remove actor To remove an actor object from an Interaction diagram: –1. Select the actor on the Interaction diagram. –2. Select Edit / Delete from Model, or press Ctrl+D.

6 Working with Objects To add an object to a Sequence diagram: –1. Select the Object toolbar button. –2. Click in the location on the diagram where you want the object to reside. In a Sequence diagram, objects are arranged in a row near the top. –3. Type the name of the new object.

7 Working with Objects Add an object to a Collaboration diagram: –1. Select the Object toolbar button. –2. Click in the location on the diagram where you want the object to reside. In a Collaboration diagram, objects can be located anywhere. –3. Type the name of the new object.

8 Deleting Objects from an Interaction Diagram Remove an object –Select the object in the Sequence or Collaboration diagram. –Select Edit / Delete from Model, or press Ctrl+D.

9 Setting Object Specifications you can set the object's name, its class, its persistence, and whether there are multiple instances of the object. To open the object specifications: –1. Right−click the object in the Sequence or Collaboration diagram. –2. Select Open Specification from the shortcut menu. OR –1. Select the object in the Sequence or Collaboration diagram. –2. Select Browse / Specification, or press Ctrl+B.

10 Naming an Object Each object on a Sequence or Collaboration diagram should be given a unique name. On an Interaction diagram, you may have two objects that are instances of the same class. To name an object: –1. Right−click the object in the Sequence or Collaboration diagram. –2. Select Open Specification from the shortcut menu. –3. In the Name field, enter the object's name. You may also use this field to change the name of the object later on.

11 Add documentation to an object: 1. Right−click the object in the Sequence or Collaboration diagram. 2. Select Open Specification from the shortcut menu. 3. In the Documentation field, you can enter documentation for the object.

12 Mapping an Object to a Class On a Sequence or Collaboration diagram, each object may be mapped to a class. In the object specification window, you can use the Class field to set the object's class. Default, the class will be set to (Unspecified). When selecting a class for the object, you can either use an existing class from your model or create a new class for the object.

13 Mapping an Object to a Class 1. Right−click the object in the Interaction diagram. 2. Select Open Specification from the shortcut menu. 3. In the Class drop−down list box, type the class name or select an option from the drop−down list box. 4. Once you have mapped the object to a class, the class name will appear with the object name on the diagram, preceded by a colon. You can toggle the display of the class name by right−clicking the object and selecting Show Class.

14 Mapping an Object to a Class Or Select the class in the Logical view of the browser. Drag the class from the browser to the object in the diagram. Once you have mapped the object to a class, the class name will appear with the object name on the diagram, preceded by a colon:

15 To remove an object's class mapping: 1. Right−click the object in the Sequence or Collaboration diagram. 2. Select Open Specification from the shortcut menu. 3. In the Class drop−down list box, select (Unspecified).

16 To create a new class for the object: 1. Right−click the object in the Sequence or Collaboration diagram. 2. Select Open Specification from the shortcut menu. 3. Select in the Class drop−down list box. Rose will take you to the specification window for the new class.

17 Setting view object and class property

18

19 Setting Object Persistence

20 Using Multiple Instances of an Object Rose provides the option of using one icon to represent multiple instances of the same class. Say, for example, that you would like to represent a list of employees on a Sequence or Collaboration diagram.

21 II. Working with Messages A message is a communication between objects in which one object (the client) asks another object (the supplier) to do something.

22 II.1 Adding Messages to a Sequence Diagram Select the Object Message button from the toolbar. Drag the mouse from the lifeline of the object or actor sending the message to the object or actor receiving the message, as shown in Type in the text of the message.

23 Add a reflexive message

24 Deleting Messages from a Sequence Diagram

25 Message Numbering in a Sequence Diagram To turn message numbering on or off: –1. Select Tools / Options. –2. Select the Diagram tab. –Set the Sequence Numbering check box to on or off, as shown in

26 Message Numbering in a Sequence Diagram

27 III Adding Messages to a Collaboration Diagram Before you can add messages to a Collaboration diagram. You have to establish a path of communication between two objects. This path is called a link, and is created using the Object Link toolbar button.

28 Add a message to a Collaboration diagram:

29 To add a reflexive message 1. Select the Link to Self toolbar button. 2. Click the object sending and receiving the message. Rose will draw a reflexive link on the object. It will appear above the object and look like a half−circle. 3.Select the Link Message toolbar button. 4. Click the object's reflexive link. Rose will add the message arrow, as shown in 5. With the new message still selected, enter the text of the message.

30 Message Numbering in a Collaboration Diagram

31 Adding Data Flows to a Collaboration Diagram Collaboration diagrams show data flows; Sequence diagrams do not. Data flows are used to show the information that is returned when one object sends a message to another. You don't add data flows to every message on a Collaboration diagram. When you eventually map each message to an operation of a class, the information in the data flows will be added to the operation's details.

32 Adding Data Flows to a Collaboration Diagram 1. Select the Data Token or Reverse Data Token toolbar button. 2. Click on the message that will be returning data. Rose will automatically add the data flow arrow to the diagram, as shown in 3. With the new data flow still selected, type in the data that will be returned.

33 IV Setting Property Message : Setting Message Specifications Double−click the message on the diagram. The message specification window will

34 Naming a Message 1. Double−click the message on the Sequence or Collaboration diagram. 2. If you have mapped the receiving object to a class, the operations of that class will appear in the Name drop−down list box. Select an entry from the list or type in the name of the message.

35 Mapping a Message to an Operation Each message on your Sequence and Collaboration diagrams should be mapped to an operation of a class.

36 To map a message to an existing operation:

37 To remove a message's operation mapping: 1. Double−click the message in the Sequence or Collaboration diagram. 2. In the Name field, delete the operation name and enter the new message name.

38 Create a new operation for the message: 1. Be sure the receiving object (the supplier) has been mapped to a class. 2. Right−click the message in the Sequence or Collaboration diagram. 3. Select. 4. Enter the new operation's name and details. 5. Click OK to close the operation specification window and add the new operation. 6. Right−click the message. 7. Select the new operation from the list that appears.

39 Setting Message Synchronization Options

40 Simple This is the default value for messages. This option specifies that the message runs in a single thread of control.

41 Setting Message Synchronization Options Synchronous Use this option when the client sends the message and waits until the supplier has acted upon the message.

42 Setting Message Synchronization Options Balking With this option, the client sends the message to the supplier. If the supplier is not immediately ready to accept the message, the client abandons the message.

43 Setting Message Synchronization Options Timeout Using this option, the client sends the message to the supplier and waits a specified amount of time. If the supplier isn't ready to receive the message in that time, the client abandons the message.

44 Setting Message Synchronization Options Asynchronous With this option, the client sends the message to the supplier. The client then continues processing, without waiting to see if the message was received or not.

45 Setting Message Synchronization Options Procedure Call With this option, the client sends the message to the supplier. The client then must wait until the entire nested sequence of messages is processed before continuing. On the Sequence diagram, procedure call messages look like this:

46 Setting Message Synchronization Options Return This option indicates the return from a procedure call. On the Sequence diagram, return messages look like this:

47 To set the message synchronization:

48 Setting Message Frequency Message frequency lets you mark a message to be sent at regular intervals. Say, for example, you have a message that should run once every 30 seconds.

49 Setting Message Frequency Periodic This option suggests that the message is sent on a regular, periodic basis. Aperiodic This option suggests that the message is not sent on a regular basis. It may be sent only once or at irregular points in time.

50 Setting Message Frequency

51 Create Interaction Diagrams

52 Setup

53

54

55

56

57

58 Collaboration diagram

59

60

61

62 Add Messages to the Diagram

63

64 7. Repeat steps 4 through 6 to add additional messages to the diagram –Add white crew socks to cart (between Cart Interface and Cart Mgr) –Get white crew socks (between Cart Mgr and Product Mgr) –Find product (white crew socks) (between Product Mgr and Product Items) –Get product (between Product Items and White Crew Socks) –Add white crew socks to cart (between Cart Mgr and Cart Items)


Download ppt "Sequence Diagrams And Collaboration Diagrams HungNM."

Similar presentations


Ads by Google