Lecture 5 Flashcards

1
Q

What are the two main components of a Class Diagram?

A

Class Attributes at the top, Class Functions at the bottom.

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

What does Inheritance represent in a Class Diagram?

A

It shows the relationship where one class inherits properties and methods from another class.

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

What does Composition represent in a Class Diagram?

A

It represents a whole-part relationship where the part cannot exist independently of the whole.

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

What does Aggregation represent in a Class Diagram?

A

It represents a whole-part relationship where the part can exist independently of the whole.

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

What does Multiplicity indicate in a Class Diagram?

A

It indicates how many instances of one class can be associated with one instance of another class.

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

What are the main objects in a Dynamic Model of a Sequence Diagram?

A

Objects, Functions, returned variables

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

What is the method used in a Dynamic Model of a Sequence Diagram?

A

find(description), (foundMatch(description), fetch(description), clone(item).

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

What does an IF / ELSE statement represent in a sequence diagram?

A

It shows conditional logic where actions are taken based on the state.

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

What does the IF condition ‘if balance >= amount’ represent in a sequence diagram?

A

If balance is greater than or equal to the amount, addDebitTransaction() and storePhotoOfCheck(theCheck).

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

What actions are taken if the IF condition ‘balance >= amount’ is not met?

A

addInsufficientFundFee(), noteReturnedCheck(theCheck), returnCheck(theCheck).

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

What does ‘getAmount()’ represent in a class diagram?

A

It is a method in the Check class.

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

What does a solid line in a sequence diagram represent?

A

A solid line represents a request sent from one object to another.

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

What does a dotted line in a sequence diagram represent?

A

A dotted line represents the return of a value or variable from a function.

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

What do the boxes in a sequence diagram represent?

A

They mean the objects are active/running.

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

What do the dashed lines in a sequence diagram represent?

A

They mean the objects are waiting.

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

What is a Practice Question for sequence diagrams?

A

Draw a sequence diagram documenting the interaction where a Game class sends a roll() message to a Dice class, which sends a nextInt(6) message to a Random class, increments the result by one, and returns it to the Game object.

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

What does a black dot represent in a Dynamic State Diagram?

A

Initial State.

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

What does a black dot with a circle outline represent in a Dynamic State Diagram?

A

End State.

19
Q

What are the three states in a Dynamic State Diagram?

A

Stopped and Reset, Keeping Time, Paused.

20
Q

What does the Video Check-out State Diagram illustrate?

A

It shows the process of checking out a video, including the event of a customer appearing.

21
Q

What happens if the event ‘Customer Appears’ does not occur in a Video Check-out State Diagram?

A

The process will not proceed to the next action and will stay on the start.

22
Q

What is a Concurrent Composite State Diagram?

A

A state diagram that shows concurrent states and transitions.

23
Q

What is shown in the Dynamic Model of a Sequence Diagram?

A

Objects and their interactions over time.

24
Q

What is the purpose of the ‘IF / ELSE’ statement in sequence diagrams?

A

To handle different scenarios based on conditions.

25
What is an example of a method used in sequence diagrams?
find(description), fetch(description), clone(item).
26
What are the 3 categories making up the 9 Constructive Principles
Modularity principles, Implementability principles, Aesthetic principles
27
List all 9 Constructive Principles
Modularity; Small Modules, Information Hiding, Least Privilege, Coupling, Cohesion Implementability; Simplicity, Design WITH Reuse, Design FOR reuse Aesthetic Principles; Beauty
28
What is Small Modules
Designs with small modules are better
29
What is Information Hiding
Each module should shield details of its internal structure and processing from other modules
30
What is Least Privilege
Modules should not have access to unneeded resources.
31
What is Coupling
Module coupling should be kept to a minimum. Coupling is the degree of connection between pairs of modules
32
What is Beauty
Beautiful designs are better
32
What is Cohesion
Modules cohesion should be maximized. Cohesion is the degree to which a module's parts are related to each other
33
What is Simplicity
Simpler designs are better
34
What is Design WITH and FOR Reuse
Designs that reuse existing assets or product reusable assets are better.
35
What are the steps to create a State Diagram
1. Identify the states and events that can occur 2. Write down the states in a box spread apart from each other 3. Connect the state boxes with lines of events that can occur that change/alter the state
36
What do the black does represent in a State Diagram
Black Dot: Initial State Black Dot with circle outline: End State
37
How is the Initial State represented in a State Diagram
Black Dot
38
How is the End State represented in a State Diagram
Black Dot with circle outline
39
If an arrow goes left to right in a Sequence Diagram, which class owns the function?
The class it points to, as it is requesting the function to that class
39
What do dashed lines in a Sequence Diagram mean
When from Sequence Path = Waiting to be activated (Vertical) When from Active Box = returned object/variable (Horizontal)
40
In a class diagram, how is Inheritance displayed
Arrow from the Subclass to the Superclass Person <--- Male
41
In a class diagram, how is Aggregation
From one class, line to aggregation class with diamond touching class with 1..* for example on it