Are fundamental guidelines and best practices that help architects and developers build robust, scalable, and maintainable software systems.
System Design Principles
Key System Design Principles
The practice of organizing code and components so that each part addresses a distinct concern or functionality.
Separation of Concerns (SoC)
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.
Single Responsibility Principle (SRP)
Software entities should be open for extension but closed for modification.
Open/Closed Principle (OCP)
Subtypes must be substitutable for their base types without altering the correctness of the program.
Liskov Substitution Principle (LSP)
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.
Interface Segregation Principle (ISP)
High-level modules should not depend on low-level modules/details. Both should depend on abstractions (e.g., interfaces).
Dependency Inversion Principle (DIP)
Involves bundling data (attributes) and methods (functions) that operate on the data into a single unit (class) while restricting access to internal implementation details.
Encapsulation
Refers to the practice of dividing a system into smaller, self-contained modules, each of which can be developed, tested, and deployed independently.
Modularity
The practice of eliminating redundancy by ensuring that code and logic are not duplicated. Instead, shared functionality should be extracted and reused.
DRY (Don’t Repeat Yourself) Principle
Systems and code should be kept as simple as possible. Complexity should only be introduced when necessary.
KISS (Keep It Simple, Stupid) Principle
Avoid adding features or functionality until it is absolutely necessary. This prevents unnecessary complexity and wasted effort.
YAGNI (You Aren’t Gonna Need It) Principle
Is a standardized modeling language used to visualize, specify, construct, and document the structure and behavior of software systems.
Unified Modeling Language (UML)
Represents the static structure of a system, showing classes, their attributes, methods, and the relationships between them.
Class Diagrams
Focuses on the dynamic behavior of the system, illustrating the flow of messages and interactions between objects over time.
Sequence Diagrams
Key Components of Class Diagrams
3 Class Compartments
Types of Relationships
Association: —
Aggregation: —◇
Composition: —◆
Inheritance: —▷
Dependency: —->
Key Components of Sequence Diagrams
Indicate a call that waits for a response
Synchronous Messages
Indicate a call that does not wait for a response
Asynchronous Messages
Represents multiple conditional paths, like an if-else scenario with more than one outcome.
Alt
Represents repetition or iteration, indicating a set of actions that are repeated until a condition is satisfied.
Loop