Lecture 8 - Design Concepts and Principles Flashcards

(41 cards)

1
Q

Compartmentalization of data and function in software represents…

A

Modularity

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

What is a procedure in software?

A

Algorithm that achieves a function

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

The degree to which a module performs one and only one function describes which Functional Independence?

A

Cohesion

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

The degree to which a module is “connected” to other modules in the system describes which Functional Independence?

A

Coupling

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

When one module directly accesses or modifies the internal data or methods of another module, what type of coupling is it?

A

Content coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
class ModuleA {
    public int data;
    public void setData(int value) {
        this.data = value;
    }
}

class ModuleB {
    public void modifyData(ModuleA ma) {
        moduleA.data = 42;
    }
}

The following is an example of what type of coupling?

A

Content coupling

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

Multiple modules sharing the same global data/resource where changes to shared resource can affect multiple modules is what type of coupling?

A

Common coupling

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

TF: Common coupling has a high level of interdependence

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
class CommonData {
    public static int sharedValue = 0;
}
class ModuleA {
    public void incrementSharedValue() {
        CommonData.sharedValue++;
    }
}
class ModuleB {
    public void decrementSharedValue() {
        CommonData.sharedValue--;
    }
}

The following is an example of what type of coupling?

A

Common coupling

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

One module influencing the control flow of another module, usually passing control information (flags, parameters) is what type of coupling?

A

Control coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
class ModuleA {
    public void process(boolean flag) {
        if (flag) {
            // Perform certain actions
        } else {
            // Perform other actions
        }
    }
}
class ModuleB {
    public void controlModuleA() {
        ModuleA moduleA = new ModuleA();
        moduleA.process(true); 
        // Control flag passed
    }
}

The following is an example of what type of coupling?

A

Control coupling

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

Modules sharing data structures such as records or arrays and only use a portion of that data is what type of coupling?

A

Stamp Coupling

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

What is one disadvantage of Stamp coupling?

A

Sharing of data structures and only using parts of it can lead to inefficiencies and unnecessary dependencies

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

Modules communicating by passing data as parameters or through method calls is what kind of coupling?

A

Data coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
class ModuleA {
    public int add(int x, int y) {
        return x + y;
    }
}
class ModuleB {
    public void performOperation() {
        ModuleA moduleA = new ModuleA();
        int result = moduleA.add(3, 4);
        System.out.println("Result: " + result);
    }
}

The following is an example of what type of coupling?

A

Data coupling

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

Modules communicating by sending messages to each other, using queues or events is what kind of coupling?

A

Message coupling

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

TF: Message coupling is a worse design practice than data coupling

A

False. Better design since reduces direct dependencies between modules

18
Q

Modules that are entirely independent of each other is what kind of coupling?

19
Q

TF: Coincidental cohesion is the strongest cohesion

A

False. Weakest cohesion

20
Q

What is coincidental cohesion?

A

When elements of a module doesn’t share any common purpose, grouped arbitrarily

21
Q

Elements within a module are grouped together because they perform related tasks describes what type of cohesion?

A

Logical cohesion

22
Q
public class CohesionExample {
    public void validateInput() {
        // Validate user input
    }
    public void calculateResult() {
        // Perform calculations
    }
    public void displayOutput() {
        // Display the result
    }
}

This is an example of what type of cohesion?

A

Logical cohesion

23
Q

Execution of elements is at the same time - such as during a single function call or at a specific event - is considered what type of cohesion?

A

Temporal cohesion

24
Q
public class CohesionExample {
    public void processOrder() {
        // Validate order
        // Calculate total
        // Generate invoice
    }
}

This is an example of what type of cohesion?

A

Temporal cohesion

25
Components of a module grouped together because they always follow a specific sequence of execution is considered what type of cohesion?
Procedural cohesion
26
``` public class CohesionExample { public void performInitialization() { // Initialize variables // Load configuration } public void performCleanup() { // Close connections // Clean up resources } } ``` This is an example of what type of cohesion?
Procedural cohesion
27
Components of a module grouped together because they operate on the same input data or communicate with same external entity is considered what type of cohesion?
Communicational cohesion
28
``` public class CohesionExample { public void readData() { // Read data from a file } public void processData() { // Process the read data } } ``` This is an example of what type of cohesion?
Communicational cohesion
29
Components of a module grouped together such that the output of one element serves as the input for the next is considered what type of cohesion?
Sequential cohesion
30
``` public class CohesionExample { public void performStep1() { // Step 1 of a multi-step process } public void performStep2() { // Step 2 of the process } } ``` This is an example of what type of cohesion?
Sequential cohesion
31
All components of a module working together to perform a single, well-defined task or function, where each module contributes to overall purpose is considered what type of cohesion?
Functional cohesion
32
TF: Functional cohesion is the strongest cohesion
True
33
``` public class CohesionExample { public void calculateTotal(int[] items) { // Calculate the total cost of items } } ``` This is an example of what type of cohesion?
Functional cohesion
34
Elements of a module grouped together because they operate on the same data or share a common data structure is considered what type of cohesion?
Informational cohesion
35
When is informational cohesion most commonly used in?
Data-centric modules
36
``` public class CohesionExample { private int[] data; public void processData() { // Process data stored in the 'data' array } } ``` This is an example of what type of cohesion?
Informational cohesion
37
TF: Temporal cohesion is considered strong cohesion when elements in a module are executed together at same time, and their execution order crucial to achieving module's specific purpose
True
38
What aspect of architectural design representation defines the components of a system (modules, objects) and how they are packaged to encapsulate both data and processing of the data?
Structural properties
39
What architectural design description addresses how design architecture achieves requirements for performance, capacity, reliability, etc.?
Extra-functional properties
40
What aspect architectural design draws upon repeatable patterns that are commonly encountered in design of similar systems?
Families of related systems
41
"Design should have the ability to reuse architectural building blocks" relates to what aspect of architectural design?
Families of related systems