Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris

Similar presentations


Presentation on theme: "1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris"— Presentation transcript:

1 1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris (d.makris@kingston.ac.uk) d.makris@kingston.ac.uk

2 2 Last week Review of SAD1-UML Review of Unified Process Workshop: Introduction to StarUML

3 3 Summary of this session Sequence Diagram Other Dynamic Views Activity Diagrams Collaboration (Communication) Diagram State Diagram Timing Diagram Interaction Overview Diagram

4 4 Summary of Elaboration Phase “A mile wide, an inch deep” approach Use Case Diagrams Define the scope and the size of the project Capture Requirements Conceptual Modelling (Class Diagrams) Define semantics Base for the final class diagrams Before the Construction phase, use cases should be assessed and ranked

5 5 Construction Phase Each Use Case defines an iteration (Analysis, Design, Implementation, Testing) Analysis: Write a detailed (full) Use Case. Use interaction (sequence) diagrams to visualise the detailed Use Case. Design: Convert the sequence diagram to collaboration. Enrich the class diagram with new classes, attributes and methods. Some other types of diagrams (state, activity) may be also used.

6 6 Activity Diagram It describes the sequencing of activities It is the UML version of the flowchart diagram In addition, it also supports concurrent activities Not necessarily an Object Oriented diagram

7 7 Activity Diagram Activity States Start-End Branch-Merge, (diamonds) Guards Fork-Join (Synch bar)

8 8 Why to use Activity Diagrams Applications Multithreaded Programming Business Modelling In Software Development process Understanding workflow (elaboration phase) Analysing a use case (construction phase) Describing a complicated sequential algorithm

9 9 Sequence Diagram Basic Notation (I) Objects Timeline Messages

10 10 Sequence Diagram Basic Notation (II) Lifeline, Activation, Creation, Destruction. Return messages Recursive calls

11 11 Types of Messages Different types of messages → Different arrowheads Some confusion in books and tools, because notation changed in the past Even Microsoft Visio & Schaum Outlines UML use the old notation. For this module, use the following (UML 2.0) notation: When an objects sends a synchronous message, it must wait for the return message to regain control. When an object sends an asynchronous message, it does not have to wait for the reply and it can keep doing other things.

12 12 Sequence Diagram in UML 2 (I) Head of lifelines: Use participants instead of objects :Order UML 2: participantUML 1.x: object

13 13 Sequence Diagram in UML2 (II) Better control of iterative and conditional flow Operators in interaction frames: Alt, opt, par, loop, region, neg, ref, sd

14 14 Sequence Diagram in practice Keep diagrams simple A4 page If diagram too complicate, split it Don’t try to capture every scenario Simple alternative scenarios can be avoid Powerful UML notation – Need for simplicity New classes Avoid (many) controller classes Avoid God classes

15 15 Sequence Diagram Summary Dynamic View Represents sequencing of actions …and behaviour assigned to objects Significantly improved in UML2.0

16 16 Collaboration (Communication) Diagram Renamed in UML 2.0  Collaboration & Sequence diagram known as interactive diagrams Almost equivalent to sequence diagram Focus on Objects Used to enrich the class diagram

17 17 Collaboration (Communication) Diagram Objects, Messages (Numbering)

18 18 State Diagrams Describe dynamic behaviour of individual object Object is treated as isolated Detect events and response State is a set of values that defines same response to events If object in different state, then response may be different for the same event State Diagram represents states and transitions

19 19 State Diagram example

20 20 Timing Diagram (I) New in UML 2.0 Usually related to a state diagram Two representations

21 21 Timing Diagram (II) New in UML 2.0 Usually related to a state diagram Two representations

22 22 Interaction Overview Diagram New in UML 2.0 Combination of activity diagram and sequence diagram

23 23 Question Why UML has so many different diagrams to represent dynamic views?

24 24 Summary Sequence Diagram shows both the sequencing of actions and the interaction between objects. Sequence Diagram is used to analyse and visualise a use case. UML offers a variety of diagrams that represent dynamic views of the system.

25 25 What is next? This week Workshop on Sequence Diagram Next week Lecture on Class Diagram (Advanced Notation)


Download ppt "1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris"

Similar presentations


Ads by Google