1 / 17

Sequence Diagrams: Modeling Interactions in Software Engineering

This chapter discusses the use of sequence diagrams in software engineering to model the interactions between actors and objects within a system. It explains how sequence diagrams are used to detail the sequence of messages exchanged between objects and actors, and how to create effective sequence diagrams for use case scenarios. The chapter also covers different types of objects, message formats, activation, and loop structures in sequence diagrams.

cteague
Download Presentation

Sequence Diagrams: Modeling Interactions in Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 9: Sequence DiagramsChapter 5 in Software Engineering Book

  2. An InteractionModel • Used to model the interactionsbetweenthe actors and the objects within a system. • 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. • Detail how operations are carried out • Dynamic Diagrams • Organizedaccording 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 use case scenario Sequence diagrams: An Interaction Model

  3. actors and objects Object lifeline Sequence Diagram (make a phone call)

  4. Sequence diagrams show how instance exchangemessages. • An instance can be: • An object, not a class • An actor • Types of objects in a diagram • interface object • entity object • control object • Messages ( ) can be Simple like: • One object sends a message to a passive object • The sender does not care what happens to the message • Messages can be Return messages ( ) Results of procedure calls Sequence Diagrams

  5. Sequence Diagrams • Activation: thick boxoverobject'slifeline; drawn when object's method is on the stack • either that object is running its code, or it is on the stack waiting for another object's method to finish • nest activations to indicate recursion

  6. Sequence Diagrams • Messages have a specific format Sequence Number. Return value := MessageName(Arguments) [Condition] *[iteration] [Condition] Sequence Number. Return value := MessageName(Arguments)

  7. Messages can be Constructors, the message creates the recipient Sequence Diagrams

  8. Sequence Diagrams • Messages can be Destructors, the message destroys the recipient.

  9. Sequence Diagrams A Found message whose Sender will not be specified

  10. Sequence Diagrams FoundMessage Message to “self” or “this”

  11. Sequence Diagrams • frame: box around part of diagram to indicate if or loop • if -> (opt) [condition] • if/else -> (alt) [condition], separated by horizontal dashed line • loop -> (loop) [condition or items to loop over]

  12. loop If/else If

  13. :Register :ProductCatalogue Sale :ProductSpec addLineItem(itemID, quantity) 1. Spec=getSpecification(itemID) 1.1 Spec=Find(itemID) 2. makeLineItem(spec,quantity) 2.1 sli= Create(spec,quantity) :SalesLineItem 2.2 Add(sli) Creating methods from sequence diagrams

  14. Creating methods from sequence diagrams LostMessage

  15. Sequence diagram for View patient information

  16. Sequence diagram to code

  17. Use only instances and actors • Concentrate on actions, not on instance static details • Imaging as much real-timescenarios 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. Effective Sequence Diagrams

More Related