SOLID Flashcards
What SOLID stand for?
Single-Responsibility Principle (SRP)
Open-Closed Principle (OCP)
Liskov Substitution Principle (LSP)
Interface Segregation Principle (ISP)
Dependency Inversion Principle (DIP)
What’s Single-Responsibility Principle (SRP)?
A class should have only one reason to change.
What’s Open-Closed Principle (OCP)?
Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
What’s Liskov Substitution Principle (LSP)?
Subtypes must be substitutable for their base types.
What’s Interface Segregation Principle (ISP)?
Clients should not be forced to depend upon methods that they do not use. Interfaces belong to clients, not to hierarchies.
What’s Dependency Inversion Principle (DIP)?
Abstractions should not depend upon details. Details should depend upon abstractions.