# SOLID

SOLID: Single Responsibility: One Reason to Change, Open/Closed: Add, Don't Edit, Liskov Substitution: No Surprises from a Stand-In, Interface Segregation:…

Updated: November 17, 2026

1. [Single Responsibility: One Reason to Change](https://www.ask-codey.com/lessons/dp-single-responsibility) (Apprentice): When one class works out the grades, lays out the report card and emails it, three different people's changes all land in the same class and can break each other; the first SOLID principle, single responsibility, says to give each class one reason to change, and this lesson opens with what SOLID is and where it came from.
2. [Open/Closed: Add, Don't Edit](https://www.ask-codey.com/lessons/dp-open-closed) (Apprentice): When every new grading scale means editing the grade function that the whole school trusts, each new scale risks breaking the old ones; the open/closed principle says to leave working code closed to edits and open to additions, so a new scale is a new class that keeps a promise, and the grade code never changes.
3. [Liskov Substitution: No Surprises from a Stand-In](https://www.ask-codey.com/lessons/dp-liskov-substitution) (Journeyman): When a pass/fail course is written as a kind of course and then throws when asked for a letter grade, every report card with art on it stops; the Liskov substitution principle says a subclass must keep every promise its parent makes, so it can stand in anywhere the parent is expected, with no surprises.
4. [Interface Segregation: Small Promises](https://www.ask-codey.com/lessons/dp-interface-segregation) (Journeyman): When one big promise makes every course answer for attendance, labs and a final exam, a course with no labs has to fake its answers, and the fakes end up on the lab report; the interface segregation principle says to make small promises, so each class keeps only what it can and each piece of code asks only for what it uses.
5. [Dependency Inversion: Depend on the Promise](https://www.ask-codey.com/lessons/dp-dependency-inversion) (Journeyman): When the report-card sender builds the school's email server inside itself, it can never send a text and can never be tested without sending real email; the dependency inversion principle says the report card should depend on a promise it owns ("a way to send"), and be handed whatever keeps it, which is the start of dependency injection.

Source: https://www.ask-codey.com/courses/design-patterns/topics/dp-solid
