Chapter 4: Software Design Flashcards

(34 cards)

1
Q

Are fundamental guidelines and best practices that help architects and developers build robust, scalable, and maintainable software systems.

A

System Design Principles

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

Key System Design Principles

A
  1. Separation of Concerns (SoC)
  2. Single Responsibility Principle (SRP)
  3. Open/Closed Principle (OCP)
  4. Liskov Substitution Principle (LSP)
  5. Interface Segregation Principle (ISP)
  6. Dependency Inversion Principle (DIP)
  7. Encapsulation
  8. Modularity
  9. DRY (Don’t Repeat Yourself) Principle
  10. KISS (Keep It Simple, Stupid) Principle
  11. YAGNI (You Aren’t Gonna Need It) Principle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The practice of organizing code and components so that each part addresses a distinct concern or functionality.

A

Separation of Concerns (SoC)

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

Each class or module in a system should have one, and only one, reason to change. This principle encourages developers to ensure that every class or component has a specific role or responsibility.

A

Single Responsibility Principle (SRP)

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

Software entities should be open for extension but closed for modification.

A

Open/Closed Principle (OCP)

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

Subtypes must be substitutable for their base types without altering the correctness of the program.

A

Liskov Substitution Principle (LSP)

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

Clients should not be forced to implement interfaces they do not use. Instead of creating large, generalized interfaces, divide them into smaller, more specific interfaces tailored to the needs of each client.

A

Interface Segregation Principle (ISP)

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

High-level modules should not depend on low-level modules/details. Both should depend on abstractions (e.g., interfaces).

A

Dependency Inversion Principle (DIP)

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

Involves bundling data (attributes) and methods (functions) that operate on the data into a single unit (class) while restricting access to internal implementation details.

A

Encapsulation

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

Refers to the practice of dividing a system into smaller, self-contained modules, each of which can be developed, tested, and deployed independently.

A

Modularity

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

The practice of eliminating redundancy by ensuring that code and logic are not duplicated. Instead, shared functionality should be extracted and reused.

A

DRY (Don’t Repeat Yourself) Principle

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

Systems and code should be kept as simple as possible. Complexity should only be introduced when necessary.

A

KISS (Keep It Simple, Stupid) Principle

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

Avoid adding features or functionality until it is absolutely necessary. This prevents unnecessary complexity and wasted effort.

A

YAGNI (You Aren’t Gonna Need It) Principle

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

Is a standardized modeling language used to visualize, specify, construct, and document the structure and behavior of software systems.

A

Unified Modeling Language (UML)

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

Represents the static structure of a system, showing classes, their attributes, methods, and the relationships between them.

A

Class Diagrams

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

Focuses on the dynamic behavior of the system, illustrating the flow of messages and interactions between objects over time.

A

Sequence Diagrams

17
Q

Key Components of Class Diagrams

A
  1. Classes
  2. Attributes
  3. Operations (Methods)
  4. Relationships
18
Q

3 Class Compartments

A
  • Class Name (top compartment)
  • Attributes (middle compartment)
  • Operations (Methods) (bottom compartment)
19
Q

Types of Relationships

A

Association: —
Aggregation: —◇
Composition: —◆
Inheritance: —▷
Dependency: —->

20
Q

Key Components of Sequence Diagrams

A
  1. Lifelines (objects)
  2. Actors (external entities)
  3. Messages (communication between lifelines)
  4. Activation Bars
  5. Return Messages
  6. Combined Fragments (conditional logic, loops, option)
21
Q

Indicate a call that waits for a response

A

Synchronous Messages

22
Q

Indicate a call that does not wait for a response

A

Asynchronous Messages

23
Q

Represents multiple conditional paths, like an if-else scenario with more than one outcome.

24
Q

Represents repetition or iteration, indicating a set of actions that are repeated until a condition is satisfied.

25
Represents an optional action, where only one outcome is possible, depending on a condition.
Option
26
Provide a structured approach to designing software systems by defining rules, patterns, and best practices for how system components interact with each other.
Architectural Styles
27
A design approach in which the system is divided into layers, each with a specific responsibility.
Layered Architecture
28
Key Components of Layered Architecture
1. Presentation Layer (UI Layer) 2. Application Layer (Business Logic Layer) 3. Data Access Layer 4. Database Layer
29
Benefits of Layered Architecture
1. Separation of Concerns 2. Scalability 3. Reusability 4. Testability
30
Drawbacks of Layered Architecture
1. Performance Overhead 2. Rigid Structure 3. Difficult to Change
31
A distributed system design in which client applications request services or resources from server applications.
Client-Server Architecture
32
Key Components of Client-Server Architecture
1. Client (sends requests) 2. Server (receives and processes requests)
33
Benefits of Client-Server Architecture
1. Centralized Control 2. Scalability 3. Flexibility 4. Modularity
34
Drawbacks of Client-Server Architecture
1. Single Point of Failure 2. Network Dependency 3. Scalability Challenges