deck_15613366 Flashcards

1
Q

What do class diagrams do?

A

They support the specification of the structure of systems by describing elements of the system and relations between them.

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

Objects in Class Diagrams (Representation)

A

An object is represented by a rectangle divided by a line. Above the line there is, e.g., HelenLewis:Student, where HelenLewis is the name of the object and Student is the class. Below the line are all of the different attributes of the object, e.g., firstName = “Helen”, secondName = “Lewis”, etc.

  • the representation shows only a snapshot of the object at a specific point in time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How are relationships between two objects/classes represented?

A

A solid line

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

Classes (Representation in Class Diagrams)

A

Similar to objects, rectangle divided in THREE compartments.

First compartment has class name, second all of the variables, and the third the operation

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

Attributes and Operations in Class Diagrams

A

Have at least a name, e.g., hours and getLecturer().

Can also have their type specified, e.g.,
hours: float and getLecturer():Lecturer

Default values can be set as follows:
hours:float = 20

hours:float {readOnly} means that the attribute’s value cannot be changed

forward slash before attribute name indicates that its value is derived from other attributes, e.g., /credits:int

optional visibility marker (+,-,#,~) denotes whether an attribute is public, private, protected, or package, respectively; e.g.,
+hours: int

multiplicity of an attribute indicates how many values it can contain (helpful to define arrays, lists, sets, etc.); e.g., hours:float [min … max]
- * can also be used to specify that there is no upper limit
- sets, multi-set, ordered sets and lists can be created by combining one of the two properties {unique}, {non-unique} and one of the two properties {ordered}, {unordered}
- the former specifies whether duplicates are allowed whilst the latter specifies whether the elements are ordered or not

static/class operations and attributes are underlined

for operations, the operation name may be followed by a list of parameters in parentheses, e.g., getName(out fn: String, out ln: String): void
- before the parameter value you add out, in or inout:
1. Out: new value for parameter after operation execution
2. In: parameter value used for operation
3. Inout: parameter value used for operation and adopts new value after execution

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

Private, Public, Protected, Package

A
  1. only an object itself knows the values of attributes marked as private
  2. anyone can view attributes marked as public
  3. access to protected attributes is reserved for a class itself and its subclasses
  4. if a class has a package attribute, only classes that are in the same package as this class may access this attribute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Binary Associations

A

show an association between the isntances of two classes with one another

represented by solid line

can be labelled with the name of the association and optionally the reading direction

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

Navigability of Binary Associations

A

indicates thatn an object knows its partner object and can therefore access their visible attributes and operations

an arrowhead indicates navigability, whilst an X indicates non-navigability

no arrowhead/X on either side indicates bidirectional navigability

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

Multiplicity of Associations

A

specify the number of objects that may be associated with exactly one object of the opposite side

also given in the form minimum…maximum or *

role names can be added to specify the role of a given object/class in an association

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

XOR Association

A

link the base class to both of the possible classes with solid lines, and then draw two dashed lines from each of those lines with an {xor} where they meet

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

N-ary association

A

involves more than two partner objects

has no navigation directions

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

Association Class

A

used to assign attributes to a relationship between classes rather than to a class itself

necessary when modelling n:m associations

dashed line from solid association line and a new class connected to that dashed line

usually, there can only be one of these classes for a given association, but this can be changed by specifying {non-unique} next to the class

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

Aggregation

A

special form of association used to express that a class is part of another class

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

Shared Aggregation

A

expresses a weak belonging of the parts to a whole, i.e., the parts also exist independently of the whole

e.g., Student is part of LabClass

multiplicity at the aggregating end may be >1 (i.e., the student may be part of multiple lab classes)

represented by an open rhombus

spans a directed acyclic graph

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

Generalisation

A

all characteristics, associations, and aggregations specified for the superclass are passed onto its subclass

every instance of the subclass is indirect instance of superclass

subclass may have further characteristics, associations and aggregations

transitive

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

Composition

A

existence dependency between the composite object and its parts

multiplicty at the aggregating end is max 1, i.e., the part can only be part of one whole

represented by a filled-in rhombus

spans a tree

if the composite object is deleted, so are its parts

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

Abstract Classes

A

used to highlight common characteristics of subclasses

ensure that there are no direct instances of the superclass

useful in the context of generalisation relationships

use keyword {abstract}

18
Q

Does UML allow multiple inheritance?

A

Yes

19
Q

Steps in Creating a Class Diagram

A
  1. Identifying the classes
  2. Identifying the attributes
  3. Identifying the relationships
20
Q

Behaviour modelling

A

the process of discovering key operations in the problem domain and building behavioural models for those operations

21
Q

Uses of State Machines Diagrams

A
  1. Model possible states of a system or object
  2. Show how state transitions occur as consequences of events
  3. Show what behaviour a system or object exhibits in each state
22
Q

When is a state active?

A

When:
1. An object is in that state.
2. All internal activities (may consist of multiple actions) can be executed.

23
Q

What does entry/Activity() mean?

A

Means that Activity() is executed when the object enters the specific state

24
Q

exit/Activity() meaning

A

Means that Activity() is executed when the object enters the specific state

25
Q

do/Activity() meaning

A

Means that Activity() is executed while the object remains in that state.

26
Q

Transition

A

a change from one state to another

specification is in the format e [g] / A, where:
- e is the event/trigger,
- g is the guard/condition
- A is the sequence of actions caused by event

27
Q

How do transitions work?

A

When the event occurs, the guard is checked.

If the guard is true, all activities in current state are terminated and any relevant exit activity is executed, carrying out the transition.

If the guard is false, the transition does not take place and the event is discarded.

The activity/effect is the sequence of actions executed during the state transition.

28
Q

Types of Transitions

A
  1. Internal transition:
    - e.g., event1/Activity3 inside of the state
    - if event1 occurs, the object remains in state1 and Activity3 is executed
  2. External transition:
    - e.g., event1/Activity3 on a line leaving the state
    - if event1 occurs, the object leaves state1 and Activity2 (exit/Activity2) is executed; afterwards, Activity3 is executed and then the object enters state1 and Activity1 is executed (in case the line leaving the state goes back to the same state)
29
Q

Types of Events

A
  1. Signal Event - involves the recipt of a signal
    - e.g., rightmousedown, SMSsent
  2. Call event - involves the calling of an operation
    - e.g., occupy(user, lectureHall), register(exam)
  3. Time event - involves a time-based transition; can be relative (based on time of occurence of event, e.g. after(5 seconds) or absolute, e.g., when(time==16:00))
  4. Any receive event:
    - keyword all for the transition
    - means that that transition is taken if any other event except those causing other transitions occur
  5. Completion event:
    - generated automatically when everything to be done in current state is completed
  6. Change event:
    - permanently checking whether condition becomes true
    - e.g., when(x>y) or after(90 min)
30
Q

Initial State

A
  • denoted by a black, filled circle
  • not a real state
  • system cannot remain in it
  • no incoming edges
  • if >1 outgoing edges, guards must be mutually exclusive and cover all possible cases to ensure that exactly one target state is reached
  • object immediately leaves this state once in it
  • no events allowed on outgoing edges
31
Q

Final state

A
  • denoted by a smaller, filled black circle circled around by another line
  • marks end of sequence of states
  • object can remain in it forever
32
Q

Terminate State

A
  • denoted by an X
  • pseudostate that terminates the state machine
  • modelled object ceases to exist/ is deleted
33
Q

Decision Node

A
  • denoted by a rhombus with one arrow coming into it and multiple going out
  • used to model alternative transitions (i.e., depending on the guard, the object can enter multiple, different states)
34
Q

Parallelisation Node

A
  • denoted by an arrow going perpendicularly into a thick black line, from which multiple lines come out
  • pseudostate that splits control flow into multiple concurrent flows
35
Q

Synchronisation node

A
  • the opposite of the parallelisation node when it comes to the nr of arrows coming in vs out
  • pseudostate that merges multiple concurrent flows
36
Q

Composite state

A
  • contains other states (substates) with only one substate being active at any time
37
Q

Configuration

A

a valid combination of (sub)states

refers to the idea that in a hierarchical state machine diagram, we can be in multiple states at the same time

38
Q

Orthogonal state

A
  • a composite state divided by a dashed line into multiple regions,
  • one state of each region is active at any point in time
  • upon entry, the initial states of all regions are activated
  • to trigger completion event, the final state must be reached in all regions
39
Q

Submachine State

A
  • a state used to reuse parts of a state machine diagram in other state machine diagrams
  • when submachine state is activated, the behaviour of the submachine is executed
  • notation: state:submachineState, where state is the name of the reference state, and submachineState is the actual state represented
40
Q

History state

A
  • remembers which substate of composite state was last active, and activates “old” substate
  • all entry activities are conducted sequentially from outside to inside of composite state
  • exactly one outgoing edge of history state points to a substate which is used if composite state was never active before or composite state was exited via final state
41
Q

Shallow History State (H without *)

A

restores the last state that you were in at depth 1

42
Q

Deep History State (H*)

A

restores the last active substate over the entire nesting depth