SOLID Principles - Set of 5 design principles for creating maintainable and scalable software. Adopting these practices can also contribute to avoiding code smells. Introduced by Robert C. Martin aka Uncle Bob.
- Single Responsibility Principle
- Open-Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
There should never be more than one reason for a class to change. Every Class should have only one responsibility.
Software entities should be open for extension, but closed for modification.
Object of a superclass shall be replaceble with objects of its subclasses without breaking the application.
Clients should not be forced to depend upon interfaces that they do not use.
Segregation means keeping things separated, and the Interface Segregation Principle is about separating the interfaces. Interfaces should be designed to be as small and specific as possible.