Lecture 6 - UML Sequence and State Diagrams Flashcards

1
Q

What are UML Class Diagrams?

A

UML Class Diagrams describe the static structure of the system
– classes,
– class attributes,
– associations between classes,
– association roles and multiplicity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are classes?

A

features and facts about the problem domain which matter in the system we are building to support it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Cinema Booking Example

A

REFER TO SLIDES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Sequence Diagrams represent?

A

Sequence diagrams represent
- the interaction of participants (horizontally)
- over time (vertically)
- using messages to communicate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Sequence Diagrams?

A
  • Sequence diagrams represent the interaction of objects (horizontally) over time (vertically).
  • SD ties use cases with objects, showing how the behaviour of a use case is distributed amongst its participating objects
  • SD provide a shift in perspective, allowing developers to find missing objects or resolve uncertainties
  • Developers should focus on problematic or under-specified functionality first, since drawing Sequence Diagrams can be time consuming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the most important components in Sequence Diagrams?

A

1.The participating objects – what are the objects associated with the use case in consideration
2.The flow of events between these objects – what are the messages that might be sent from the sender object to the receiver objects?
===
NOTE:
- Most of the main objects should have already been identified when we come to analyze sequence diagrams.
- Through dynamic modelling, new objects that were not identified may emerge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the conventions for Sequence Diagrams?

A

Layout
Object Creation
Object Access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the conventions for Sequence Diagrams - Layout?

A

Layout:
1st column: corresponds to the actor who initiated the use case
2nd column: Should be a boundary object with which the actor interacts to initiate the case
3rd column: Should be the control object that manages the rest of the use case
4th column: An entity object representing long-lived info tracked by the

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the conventions for Sequence Diagrams - Object Creation?

A

Object Creation:
– Control objects are created by boundary objects initiating the use case
– Other boundary objects are created by control objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the conventions for Sequence Diagrams - Object Access?

A

Object Access:
– Entity objects are accessed by control and boundary objects,
– Entity objects should never access boundary or control objects:
This makes it easier to share entity objects across use cases
and makes entity objects resilient against technology-induced
changes in boundary objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Order Pricing Example

A

REFER TO SLIDES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Create New Online Library Account EXAMPLE

A

REFER TO SLIDES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When do you use Sequence Diagrams?

A
  • You should use sequence diagrams when you want to look at the
    behavior of several objects within a single use case.
  • Sequence diagrams are good at showing collaborations among the objects;
  • they are not so good at precise definition of the behavior.
  • If you want to explore multiple alternative interactions quickly, you may be better off with CRC cards, as that avoids a lot of drawing and erasing. It’s often handy to have a CRC card session to explore design alternatives and then use sequence diagrams to capture any interactions that you want to refer to later.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are State Diagrams?

A
  • A UML state diagram is a notation for describing the sequence of states an object goes through in response to external events.
  • UML state machines are extensions of the finite state machine model.
  • A state is a condition satisfied by the attributes of an object.
  • A transition indicates a move from one state to another
  • An event is a potential trigger for a change of state
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do State Machine Models show?

A

Show how individual objects change their state in response to events.
* They are represented in the UML using state chart diagrams.
* While sequence diagrams are used to model the combined behaviour of a group of objects in the system, the state chart diagrams are used to model the behaviour of a single object in response to external events.
* In the context of behaviour modelling, 2 different characterizations of states must be considered:
1. the state of each class, and
2. the state of the system as observed from the outside as the system performs its function
REFER TO SLIDES FOR DIAGRAMS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Statechart Diagrams?

A
  • Graphs whose nodes are states and whose directed arcs are transitions labelled by events.
  • States capture conditions which hold for a period of time
  • Events change the state (except internal)
  • Statechart diagrams represent behaviour from the perspective of a single object only– An object model with a set of objects must be represented by a set diagrams
17
Q

What is a state and what are its characteristics?

A
  • An abstraction of the attributes of a class– State is the aggregation of several attributes of a class
  • Basically an equivalence class of all those attribute values and links that do not need to be distinguished as far as the control structure of the system is concerned – Example: State of a user interface screen
  • logged in, logged out, active, idle
  • active is an abstraction of all the user’s logged in activity
  • State has duration
18
Q

What is an Event?

A
  • Something that happens at a point in time (e.g. button press, mouse click)
  • Triggers a transition– Internal transition (no state change)– External transition (change to different state)
  • May result in an action being executed
19
Q

State Chart Diagram vs Sequence Diagram

A
  • State diagrams help to identify:
    – Changes to objects over time
  • Sequence diagrams help to identify
    – The temporal relationships between objects over time
    – Sequence of operations as a response to one or more events
20
Q

When do you use state diagrams?

A
  • State diagrams are good at describing the behavior of an object across several use cases.
  • State diagrams are not very good at describing behavior that involves a number of objects collaborating.
  • Therefore it is useful to combine state diagrams with other techniques.
  • If you do use state diagrams, don’t try to draw them for every class in the system. … it is almost always a waste of effort.
  • Use state diagrams only for those classes that exhibit interesting behaviour, where building the state diagram helps you understand what is going on.
  • Many people find that User Interface and Control objects have the kind of behaviour that is useful to depict with a state diagram.