sequence diagrams chapter 5 sommerville. sequence diagrams sequence diagrams are part of the uml and...

17
Sequence diagrams Chapter 5 Sommerville

Upload: della-ryan

Post on 24-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence diagrams

Chapter 5Sommerville

Page 2: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence diagrams

• Sequence diagrams are part of the UML and are used to model the interactions between the actors and the objects within a system.

• A sequence diagram shows the sequence of interactions that take place during a particular use case or use case instance.

• The objects and actors involved are listed along the top of the diagram, with a dotted line drawn vertically from these.

• Interactions between objects are indicated by annotated arrows.

2Chapter 5 System modeling

Page 3: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence diagram for View patient information

3Chapter 5 System modeling

Page 4: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence diagram for Transfer Data

4Chapter 5 System modeling

Page 5: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Detail how operations are carried out• Dynamic Diagrams• Organized according to time

– The time progresses as you go down the page – The objects involved in the operation are listed

from left to right according to when they take part in the message sequence.

• Create a sequence diagram for each scenario

Page 6: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams : Customer

: Order

: item

: payment

1. CreateOrder

2. request

3. addToOrder(:item)

4. Checkout4.1. CreatePayment

4.1.1. GetPaymentInfo

4.1.1.1. PaymentInfo

4.1.1.1.1. Success

4.3. Order Result

4.2. Save or decline

Page 7: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams• Sequence diagrams show how instance

exchange messages.• An instance can be:

– An object, not a class– An actor

• Object-Types in sequence Diagram– 1- interface object– 2-entity object – 3-control object

• Sequence diagrams contain the same information as Collaboration diagrams, but emphasize the sequence of the messages instead of the relationships between the objects.

Page 8: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Messages can be Simple like– One object sends a message to a passive object– The sender does not care what happens to the

message– Useful when the recipient can not be controlled

• Messages can be Return messages – Results of procedure calls

Page 9: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

د. محمود القوتلي تحليل النظم

Page 10: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Messages can be Constructors, the message creates the recipient

• Messages can be Destructors, the message destroys the recipient. : Customer

: Order1. Create

: Customer

: Order1. Create

2. Destroy

Page 11: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Messages have sequence numbers– The numbers represent the order of interaction

: Customer

: Order1. Create

2. Destroy

Page 12: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Messages have sequence numbers– Sequence number can be hierarchical

: Customer

: Item

: store

1. Create

1.1. CheckStock

1.1.1. Yes

Page 13: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Sequence Diagrams

• Messages have a specific format

[Condition]Sequence Number. Return value := MessageName(Arguments)

[Condition]Sequence Number. Return value := MessageName(Arguments)*[iteration]

Page 14: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Effective Sequence Diagrams

• Use only instances and actors• Concentrate on actions, not on instance static details• Imaging as much real time scenarios as you can, and

model them• Keep in mind that a programmer will read your design,

so make it as clear as possible.• Sequence diagrams contain the same information as

Collaboration diagrams, but emphasize the sequence of the messages instead of the relationships between the objects.

Page 15: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Behavioral models

• Behavioral models are models of the dynamic behavior of a system as it is executing. They show what happens or what is supposed to happen when a system responds to a stimulus from its environment.

• You can think of these stimuli as being of two types:– Data Some data arrives that has to be processed by the

system.– Events Some event happens that triggers system

processing. Events may have associated data, although this is not always the case.

15Chapter 5 System modeling

Page 16: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

Data-driven modeling

• Many business systems are data-processing systems that are primarily driven by data. They are controlled by the data input to the system, with relatively little external event processing.

• Data-driven models show the sequence of actions involved in processing input data and generating an associated output.

• They are particularly useful during the analysis of requirements as they can be used to show end-to-end processing in a system.

16Chapter 5 System modeling

Page 17: Sequence diagrams Chapter 5 Sommerville. Sequence diagrams Sequence diagrams are part of the UML and are used to model the interactions between the actors

An activity model of the insulin pump’s operation

17Chapter 5 System modeling