Class Diagrams Flashcards

1
Q

class

A

a construction plan for a set of similar objects

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

operation <-> method

A

operation - specification
method - implementation

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

class structure

A

name
attributes
operations

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

attribute visibility

A
    • public: every other class
    • private: only the class itself
  • # protected: class itself and subclasses
  • ~ package: classes in the same package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

primitive data type

A

pre-defined
user-defined

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

pre-defined types

A

Boolean, Integer, String, UnlimitedNatural

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

user-defined

A

These are custom data types that the user can define using the stereotype «primitive». They represent atomic values and can’t be broken down into more specific types within UML models

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

composite

A

Represented with the stereotype «datatype», these types are similar to classes but specifically used for defining value types
- Instances are values not objects
- Identity defined by its properties
- Immutable

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

enumerations

A

Enumerations are special data types defined with the stereotype «enumeration» in UML.
They specify a list of possible named values, known as enumeration literals, that an instance of this type can assume.

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

Pre-defined properties

A
  • {readOnly} … value cannot be changed
  • {unique} … no duplicates permitted
  • {non-unique} … duplicates permitted
  • {ordered} … fixed order of the values
  • {unordered} … no fixed order of the values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Direction of the parameter

A
  • in … input parameter
    • When the operation is used, a value is expected from this parameter
  • out … output parameter
    • After the execution of the operation, the parameter has adopted a new value
  • inout : combined input/output parameter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Default

A

instance variable (= instance attribute): attributes defined on the instance level

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

Class variable (= class attribute, static attribute)

A
  • Defined only once per class,
    • i.e., shared by all instances of the class
    • e.g., counters for the number of instances of a class, constants, etc.
  • Class operation (= static operation)
    • Can be used if no instance of the corresponding class was created
      • e.g., constructors, counting operations, math functions, etc.
  • Notation: underlining the name of class variable or class operation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

coarse grained -> fine grained

A

Name -> Name + Attributes + Operations -> Name + Attributes with V,Dt + Operations with V, Dt

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

navigability

A

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

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

non-navigability

A

Indicated by a cross, but this is also often left out

17
Q

Aggregation

A

Used to express that a class is part of another class

  • Properties of the aggregation association:
    • Transitive: if B is part of A and C is part of B, C is also part of A
    • Asymmetric: it is not possible for A to be part of B and B to be part of A simultaneously
  • Two types:
    • (Shared) aggregation
    • Composition
18
Q

generalisation

A

transitive

19
Q

Generalization – abstract classes

A
  • Used to highlight common characteristics of their subclasses while ensuring no direct instances of the superclass
  • Only its non-abstract subclasses can be instantiated