Class Diagram (I) Flashcards

(20 cards)

1
Q

What is a class diagram?

A

A picture that shows classes, their attributes, operations, and relationships in a system.

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

What is an object?

A

An individual instance of a class (e.g., a specific ‘Student’ named ‘Alice’).

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

What is a class?

A

A blueprint for objects (e.g., ‘Student’ class defines all students).

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

What are attributes?

A

Properties of a class (e.g., ‘Student’ has ‘name’ and ‘age’).

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

What are operations?

A

Actions a class can do (e.g., ‘Student’ can ‘enroll()’).

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

What is visibility in attributes/operations?

A

Who can access them: ‘+’ (public), ‘-‘ (private), ‘#’ (protected), ‘~’ (package).

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

What is a derived attribute?

A

An attribute calculated from others (e.g., ‘age’ from ‘birthDate’).

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

What is multiplicity?

A

How many values an attribute can have (e.g., ‘[1..*]’ means at least one).

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

What is a class variable (static attribute)?

A

Shared by all objects of a class (e.g., ‘totalStudents’ counter).

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

What is a class operation (static method)?

A

A method called on the class, not an object (e.g., ‘getTotalStudents()’).

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

What is an association?

A

A relationship between classes (e.g., ‘Student’ attends ‘Course’).

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

What is navigability?

A

Whether one class can ‘see’ another (arrow points to the accessible class).

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

What is multiplicity in associations?

A

How many objects are linked (e.g., ‘1 Teacher’ to ‘* Students’).

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

What is a role in associations?

A

The part a class plays in a relationship (e.g., ‘Teacher’ as ‘instructor’).

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

What is an XOR constraint?

A

An object can link to only one of two classes (e.g., ‘Payment’ is either ‘Cash’ OR ‘Card’).

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

What is a unary association?

A

A class linked to itself (e.g., ‘Employee’ manages ‘Employee’).

17
Q

What is an n-ary association?

A

A relationship involving 3+ classes (e.g., ‘Student’, ‘Course’, ‘Teacher’).

18
Q

What’s the difference between ‘ordered’ and ‘unordered’?

A

‘Ordered’ = fixed sequence (e.g., rankings); ‘unordered’ = no sequence (e.g., tags).

19
Q

What does {readOnly} mean?

A

The value can’t be changed after creation (e.g., ‘studentID’).

20
Q

What’s an object diagram?

A

A snapshot of objects and their links at a specific time.