Solid Link to heading
Single Responsibility Principle Link to heading
- A class should have only one reason to change.
Open/Closed Principle Link to heading
- Software entities should be open for extension but closed for modification.
Liskov Substitution Principle Link to heading
- Derived classes must be substitutable for their base classes.
Interface Segregation Principle Link to heading
- A class should not be forced to implement interfaces it does not use.
- Avoid creating large, monolithic interfaces. Instead, create smaller. more focused interfaces
Dependency Inversion Principle Link to heading
- Depend on abstractions, not on concretions.
Solid are principles and they are important because: Link to heading
- Maintainability: simplifies modifying and extending the codebase.
- Scalability: promotes reusable and modular components.
- Testability: makes unit testing easier by reducing tightly coupled dependencies.
- Readability: code becomes more structured and understandable.