- Single Responsibility Principle (SRP)
- Every software component should have one and only one reason to change - Uncle Bob
- Every software component should have one and only one responsibility
- Component can be a class, method, or module
- Cohesion and Coupling - High Cohesion, Low Coupling helps attain better adherence to the SRP
- Cohesion is the degree to which the various parts of a software component are relate
- Coupling is defined as the level of inter dependency between various software components
- Open-Closed Principle - Open for Extension, Closed for Modification
- Liskov Substitution Principle - Objects should be replaceable with their subtypes without affecting the correctness of the program
- Interface Segregation Principle - No client should be forced to depend on methods it does not use
- Dependency Injection Principle - High-level modules should not depend on low-level modules. Both should depend on abstractions.
- Abstractions should not depend on details. Details should depend on abstractions
24 Feb 2024 - Reading Time: 1 minutes