Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sequence Diagram Lecture # 1. Sequence Diagram Definition A Sequence diagram is an interaction diagram that shows how the objects and classes involved.

Similar presentations


Presentation on theme: "Sequence Diagram Lecture # 1. Sequence Diagram Definition A Sequence diagram is an interaction diagram that shows how the objects and classes involved."— Presentation transcript:

1 Sequence Diagram Lecture # 1

2 Sequence Diagram Definition A Sequence diagram is an interaction diagram that shows how the objects and classes involved in the scenario operate with one another. the sequence of messages exchanged. Sequence diagram is interaction diagram that shows the set of objects and messages send and receive by those object. It mainly emphases on time ordering and messages.

3 Its Significance An organization's technical staff can find sequence diagrams useful in documenting how a future system should behave. During the design phase, architects and developers can use the diagram to force out the system's object interactions, thus fleshing out overall system design.

4 Sequence Diagram Key Parts participant: object or entity that acts in the diagram – diagram starts with an unattached "found message" arrow message: communication between participant objects the axes in a sequence diagram: – horizontal: which object/participant is acting – vertical: time(down -> forward in time)

5 Target Ramakant Soni @ EISTI Cergy12/2/2014 5 Objects as well as classes can be targets which means that messages can be sent to them. A target is displayed as a rectangle with some text in it. Below the target, its lifeline(vertical dashed line) extends for as long as the target exists. Target Lifeline

6 Objects or Participants  The sequence diagram is made up of collection of participants or objects. Participants are system parts that interact each other during sequence diagram.  The participants interact with each other by sending and receiving message

7 Actor

8 Lifeline  Lifeline represents the existence of an object over a period of time.  It is represented by vertical dashed line.  Most objects that appeared in ‘Interaction diagram’ will be in existence for the duration of an interaction. So, these objects are aligned at top at top of diagram with their lifeline from top to bottom of diagram.

9 Activation bar  It is also called as focus of control. It shows the period of time during which an object is performing an action.  The top of rectangle is aligned with start of the action. The bottom is aligned with its completion and can be marked by a written message  It is represented by tall thin rectangle:

10 Messages . The interaction in a sequence diagram between the objects can be shown by using messages.  The messages on sequence diagram are specifies using an arrow from participant that wants to pass the messages to the participant that receive the messages.  Messages can be flow in whatever direction required for interaction from left to right and right to left.

11 Messages It has following kinds of messages: 1)Synchronous messages:- * It is a message where the sender is blocked and waits until the receiver has finished processing of message. * It is invoked the caller waits for the receiver to return from the message invocation. * It is represented by solid line with full arrow. 2)Asynchronous messages:- * It is a messages where the sender is not blocked and can continue executing. * It is represent by solid line with half arrow.

12 Synchronous Message

13 Asynchronous Message

14 Messages  It has following kinds of messages: 3)Reflexive messages:- * If the object sends the message to itself then it is called as ‘Reflexive message. * It is represented by solid line with loops the lifeline of object. 4)Return messages:- * It can be used at the end of activation bar to show that control flow of activation returns to the participant that pass the original message. * It is represent by dashed line from sender to receiver.

15 Return Message

16 Reflexive Message

17 Create messages It is used to create object during interaction. The object can be created by using > to indicate the timing of creation. Creating message can be shown as below:

18 Creating Objects ObjectOne > ObjectTwo message The lifeline is destroyed > X

19 Creating Objects WebInterface Database Wrapper Validate User [logged in] Retrieve User [invalid user] > MessageBox [invalid user] Display Error Message [invalid user] > X

20 Destroy messages It is used to destroy the objects during interaction. The objects can be terminated using > which points to an “x”. It indicates that object named message is terminated.

21 Example

22 Time  The sequence diagram describes the order in which interaction takes place.  So time in an important factor. The time on sequence diagram starts at top of the page just below the object and then progress down the page.  Time is all about ordering but not duration.

23 Messages

24 Message Types & representation

25 Example

26 Sequence Diagram (make a phone call) CallerPhoneRecipient Picks up Dial tone Dial Ring notification Ring Picks up Hello

27 Example

28

29 Case Study Model a Sequence Diagram: Case Study The following requirements are for a computerized grading system: The teacher views the grades for a student successfully The teacher attempts to view the grades for a student but the student doesn’t exist in the system The teacher attempts to view the grades for a student but the student does not have any grades

30 2. Lay Out Objects StudentInfo WebInterface Database Wrapper Teacher Student Grades

31 3. Include Messages and Conditions StudentInfo WebInterface Database Wrapper Teacher Student Grades Request Student Info Get Student Data Load Student Return Student Info Load Grades Return Grades for Student Return Student Info Display Student Info

32 4. Include conditions StudentInfo WebInterface Database Wrapper Teacher Student Grades Request Student Info Get Student Data Load Student (Student not found) (Failure) > MessageBox Display Error > X

33 UML Diagrams for ATM: Use Case

34 Sequence diagram

35 Add Doctor

36 Validate Passward

37 LOGIN


Download ppt "Sequence Diagram Lecture # 1. Sequence Diagram Definition A Sequence diagram is an interaction diagram that shows how the objects and classes involved."

Similar presentations


Ads by Google