Class Diagram Flashcards

1
Q

What are the two families of software models?

A

Static
- class diagrams, etc
Dynamic
- activity diagrams, use case diagrams, etc.

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

What is a class diagram?

A

Shows the classes of a system and the associations between those classes.
Each class may have some knowledge about associated classes.

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

What are the main symbols shows in UML?

A

Classes
associations - linkage between data
attributes
operations - methods
generalizations - group classes into inheritance hierarchies

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

What is an association?

A

Used to show how classes are related to each other.

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

What is multiplicity

A

Defines how many instances can be associated at any given moment.
[Employee] * ———————– 1 [Company]

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

What is generalization?

A

Usually represents some kind of inheritance, as a clarification
Example, doctor is the parent class of clinic_doctor and hospital_doctor.
Represented by empty arrows.

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

Associations vs generalizations

A

Associations describe the relationships that will exist between instances at run time.

Generalizations describe relationships between classes in class diagrams

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

What is an aggregation

A

special association that represent “is part of” association.
example:
Vehicle<>——–Vehicle part

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

What is composition

A

A stronger version of the aggregation. If the aggregate (vehicle) is destroyed, then the parts of it must be destroyed as well.

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

What are interface

A

And interface describes a portion of the visible set of objects
Think of the java interface.
ATM class and employee class can call widthdraw/deposit on the interface

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

Different notations for multiplicity

A

0..1 No instances or one instance A flight seat can have no or one passenger only
1 Exactly one instance An order can have only one customer
0..* or * Zero or more instances A class can have zero or more students
1..* One or more instances (at least one) A flight can have one or more passenger

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

Direction and bi-directional association

A

direcitonal:
car -> customer
car has a customer attribute

bidirectional:
car <-> customer
car has customer attribute, customer has car attribute

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

When to use an aggregation:

A

As a general rule, you can mark an association as an aggregation if the followings are true:
You can state that
the parts ‘are part of’ the aggregate
or the aggregate ‘is composed of’ the parts
When something owns or controls the aggregate, then they also own or control the parts

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