SOLID Design Principles
A set of guidelines for making code more reusable and reliable.
SRP
Single Responsibility Principle: A class should have only one reason to change.
OCP
Open-Closed Principle: Open for extension, closed for modification.
LSP
Liskov Substitution Principle: Subtypes must be substitutable for their base types. Penguin’s fly() method would throw an error if fly() is built into Bird. Instead create a separate FlyingBird class inheriting from Bird.
ISP
Interface Segregation Principle: Don’t force clients to depend on methods they don’t use. Keep interfaces small.
DIP
Dependency Inversion Principle: High-level modules should not depend on low-level modules.
Both should depend on abstractions.