SOLID principles
The SOLID principles are five design guidelines for object-oriented software, meant to keep it easier to understand, extend, and maintain as it grows. Robert C. Martin gathered the underlying ideas around 2000, and Michael Feathers later arranged their initials into the mnemonic acronym SOLID.
Each letter names one principle of object-oriented design, and each targets a specific source of fragility in a growing codebase, from tangled responsibilities to rigid dependencies:
- Single responsibility: A class should have only one reason to change, so unrelated concerns stay in separate code.
- Open-closed: Software entities should be open for extension but closed for modification, so new behavior can be added without rewriting what already works.
- Liskov substitution: A subtype should be usable anywhere its base type is expected, without breaking the correctness of the program.
- Interface segregation: A caller should not be forced to depend on methods it never uses, which favors small, focused interfaces.
- Dependency inversion: High-level and low-level code should both depend on abstractions rather than on concrete implementations.
The principles are guidelines rather than strict rules, and they overlap in practice. Used with judgment, they lower coupling and keep changes local, though applying them too rigidly can add indirection that outweighs the benefit.
Related Resources
Tutorial
SOLID Design Principles: Improve Object-Oriented Code in Python
Learn how to apply SOLID design principles in Python and build maintainable, reusable, and testable object-oriented code.
For additional information on related topics, take a look at the following resources:
- Object-Oriented Programming (OOP) in Python (Tutorial)
- Design and Guidance: Object-Oriented Programming in Python (Course)
- A Conceptual Primer on OOP in Python (Course)
- Python Classes: The Power of Object-Oriented Programming (Tutorial)
- Inheritance and Composition: A Python OOP Guide (Course)
- Refactoring Python Applications for Simplicity (Tutorial)
- SOLID Design Principles: Improve Object-Oriented Code in Python (Quiz)
- Intro to Object-Oriented Programming (OOP) in Python (Course)
- Object-Oriented Programming (OOP) in Python (Quiz)
- Class Concepts: Object-Oriented Programming in Python (Course)
- Inheritance and Internals: Object-Oriented Programming in Python (Course)
- Python Classes - The Power of Object-Oriented Programming (Quiz)
By Martin Breuss • Updated Aug. 13, 2026