What is SOLID?
Options
- Five OO design principles: SRP, OCP, LSP, ISP and DIP (Correct option)
- A cloud storage product for large files
- A type of database that stores solid objects
- Five Agile ceremonies held during a sprint
Answer
Five object-oriented design principles: Single responsibility, Open-closed, Liskov substitution, Interface segregation, Dependency inversion
Why
SOLID is a set of five guidelines to keep object-oriented code easy to change. They were introduced by Robert C. Martin, and the acronym was coined later by Michael Feathers.
- S: a class should have one reason to change.
- O: extend behavior without modifying existing code.
- L: a subclass must be usable wherever its parent is expected.
- I: prefer small, focused interfaces.
- D: depend on abstractions, not concrete classes.
Remember
SOLID = five design principles (SRP, OCP, LSP, ISP, DIP).