Skip to content

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.

SOLID Principles: Improve Object-Oriented Design in Python

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.

intermediate best-practices python

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated Aug. 13, 2026