graphical systems modeling with uml /...

29
Graphical Systems Modeling with UML / SysML Sequence diagrams © Piotr Ciskowski

Upload: others

Post on 16-Jun-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Graphical Systems Modeling

with UML / SysML

Sequence diagrams

© Piotr Ciskowski

Page 2: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

behavior

• sequence diagram

• activity diagram

• state machine diagram

• interaction overview diagram

• communication diagram

• timing diagram

• package diagram

Perspectives - views:

Use case

view

Logical view

architecture

• class diagram

• object diagram

• composite structure diagram

• package diagram

Dynamic View

Implementation View

Deployment View

system scope& functionality

•use case diagram• package diagram

software

• component diagram

• package diagram

hardware

• deployment diagram

• package diagram

Page 3: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Sequence diagram

• describes interactions between instances

as sequences of messages passed between them

• documents functionality of a use case

• shows:

� flow of control

� order and location of performed operations

� exchange of messages between objects – chronologically

� logic of methods and services

• close to code

• horizontally - classifiers’ instances - statics

• vertically - time - dynamics

Page 4: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Sequence diagram

• types of diagrams – levels of detail / abstraction:

� conceptual - general scope

- evident interactions

� implementational - very precise

- all types of elements

- main flow and all alternative flows

- complete specification

- for programmers / CASE tools

� instance - implementational for a certain scenario

Page 5: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

SEQUENCE DIAGRAM BASIC ELEMENTS

Page 6: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Basic elements:

– objects, actors(classifiers’ instances)

– lifelines

– messages

– activation - focus of control

- object active / inactive

Page 7: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

SEQUENCE DIAGRAM ADVANCED ELEMENTS

Page 8: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Advanced elements

• on detailed implementation diagrams:

– different types of messages

– creating and destroying objects

– conditions

– messages to self (self messages)

– duration and time constraints

– combined fragments

– interaction uses

– gates

Page 9: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

MESSAGES

Advanced elements

Page 10: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Messages

• synchronous call

• asynchronous call

• asynchronous signal

• reply

• self

• create

• delete

� lost

� found

image: Sparx Systems – UML 2 Tutorial

Page 11: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

OTHER ELEMENTS

Advanced elements

Page 12: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Other elements

• conditions

• iterations

• forks

• constraints(time & duration)

Page 13: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

COMBINED FRAGMENTS

Advanced elements

Page 14: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

• combined fragment - part of sequence diagram

enclosed in a frame

executed under specific circumstances

- adds procedural logic

• operator - how to interpret

• operand - what to do

Page 15: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– alt - alternative

- if–then-else

- switch

image: www.uml-diagrams-org

Page 16: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– opt - option

- alt with only one operand

image: www.uml-diagrams-org

Page 17: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– break - breaking or exceptional scenario

- performed instead of other interactions

image: www.uml-diagrams-org

Page 18: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– loop - iteration

loop (n)

loop (min,max)

loop

images: www.uml-diagrams-org

Page 19: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– neg - invalid series of messages

image: www.uml-diagrams-org

Page 20: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– par - parallel, concurrent processing

image: www.uml-diagrams-org

Page 21: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– par - simplified notation

image: www.uml-diagrams-org

Page 22: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– critical - critical section

- highest priority

- object „reservation”

image: www.uml-diagrams-org

Page 23: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– consider - ignore

consider { <messages> }

ignore { <messages> }

images: www.uml-diagrams-org

Page 24: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– strict - strict order (sequencing)

image: www.uml-diagrams-org

Page 25: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– seq - weak sequencing

image: www.uml-diagrams-org

Page 26: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments

– ref - other interaction use

images: www.uml-diagrams-org

Page 27: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Combined fragments:

– alt - alternative

– opt - option

– break - breaking or exceptional scenario

– loop - iteration

– neg - invalid actions

– par - parallel processing

– critical - critical section, highest priority

– consider, ignore

– strict, seq - strict order, weak sequencing

– ref - reference to other interaction

Page 28: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

SUMMARY

Page 29: Graphical Systems Modeling with UML / SysMLstaff.iiar.pwr.wroc.pl/piotr.ciskowski/dydaktyka/inzynieria.oprogramo... · – alt - alternative – opt - option – break - breaking

Sequence diagram

Steps:

1. analyze use cas scenario

2. identify classifiers to take part in the interaction

3. create conceptual diagram:

– classifiers’ instances – horizontally

– ordered messages - vertically

– execution boxes

4. create implementation diagram:

– all other details, advanced elements and full specifications needed

5. create instance diagram