Class Diagrams Flashcards

1
Q

purpose of a class diagram

A

describe the static structure of a system in a visual form

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

do class diagrams show the fucntional requirements of a system

A

no

use case models do this

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

do class diagrams show how classes interact at run time

A

no

interaction diagrams used for this

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

3 parts of a class symbol in order

A
  1. class name
  2. attributes
  3. operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does it mean if an object is persistant

A

stored, once the program is done, there is still a record of this object

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

what does it mean if an object is transistory

A

only in existence while the program is running

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

what is an attribute of a class

A

a property that describes a range of values that theobjects of that class may hold

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

how would you show an attribute’s visibility in the class diagram

A

+ public
- private

eg + attributeName

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

how would you show an attribute’s type in the class diagram

A

:

eg. attributeName: int

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

how would you show an attribute’s multiplicity in the class diagram

A

[0…1]

eg attributeName [0..1]: String

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

how would you show an attribute that has an initial value in the class diagram

A

=

eg attributeName : int = 5

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

what are derived attributes

A

attributes who’s value is a result of a computation based on other attribute values

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

how to represent derived attributes in class diagrams

A

/aatributeName

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

where are operations (methods) of a class listed

A

just below attributes

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

how to show association between two classes

A

draw a line and add association name

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

how to show cardinality in associations

A
  1. n means one or more

0. n means 0 or more

17
Q

what is generalisation in class diagrams equivalent to in java

A

inheritence

18
Q

example of generalisation

A
student in main class
undergrad and post grad are sub classes
19
Q

what is aggregation

A

when one class is made up of those of another but both can exist in their own right also

20
Q

what is composition

A

when one class is made of of another but it cannot exist in it’s own right