Design Principles Flashcards

1
Q

bad software design exhibits at least one of which 3 traits?

A

Rigidity, Fragility or Immobility (While still satisfying main requirements)

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

Define: Rigidity

A

Rigid if software is hard to change, because every change effects many other parts of the system

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

Define: fragility

A

System is fragile if, when changes are made, unexpected parts of the system break

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

Define: Immobility

A

Immobile if system is hard to use in another app, because it is difficult to disentangle from current app

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

Define: System

A

A set of cohesive modules working together to satisfy a set of requirements

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

Define: Pre-Condition

A

Checking the validity of an input before it is used

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

Define: Post-Condition

A

Condition that must evaluate to true after the execution of some code

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

Define: Coupling

A

How reliant a module is on its neighbors

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

Define: Cohesion

A

The strength of a relationship between a module and its neighbors

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

Define: System Boundary

A

The definition of what aspects are part of the system, and which aspects are not.

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

Define: Single Responsibility Principle

A

every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class

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

Rule for connections between modules

A

If a system has n modules, the # of connections should be closer to (n-1) than to (n(n-1)/2)

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

Layers vs. Partitions

A

Layers: Reliant on other layers to function Increases coupling
Partitions: Not reliant on other partitions to function. Decreases coupling

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

Perks of high cohesion?

A

Complexity is manageable

Good code readability and reusability

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

Features of Modularity

A

De/Recomposability
Understandability
Continuity
Protection

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

Define: Modular Continuity

A

System satisfies continuity if a small change to the specification triggers a change in only one/few modules

17
Q

Define: Modular Protection

A

System satisfies protection if, when an abnormal condition occurs at runtime, the effect of such will either stay confined to that module or to few neighboring modules

18
Q

Define: Modular Understandability

A

System satisfies modular understandability if its modules can be understood independently/mostly independently

19
Q

Define: Modular Reusability

A

Components should be sufficiently independent from their source of existence

20
Q

Why are modules w/ high coupling undesirable?

A
A change in one module usually forces a ripple effect of changes in other modules.
Assembly of modules might require more effort and/or time due to the increased inter-module dependency.
A particular module might be harder to reuse and/or test because dependent modules must be included.
21
Q

Countermeasures in a class with low cohesion?

A

Try to group like functionalities into another class

22
Q

Pro/Cons of Manager Objects?

A

Pros:
Related functionalities are grouped.
Easier to manage components from single location.
Cons:
Violates the ‘single responsibility principle’, class is less robust as a result

23
Q

Define: Modular Decomposability

A

If construction method helps to break up a large software problem into smaller less complex sub-problems, we consider it to be modularly decomposable