SOLID Principles

framework · computer science · organizing-schema

Single responsibility, Open-closed, Liskov substitution, Interface segregation, Dependency inversion.

SOLID is a mnemonic for five principles of object-oriented design and programming articulated by Robert C. Martin ('Uncle Bob') across articles in the 1990s and consolidated in subsequent works including Agile Software Development (2002) and Clean Code (2008). Single Responsibility Principle (SRP): a class should have only one reason to change, often summarized as 'one responsibility' though Martin's intended meaning is closer to 'one stakeholder driving change'. Open-Closed Principle (OCP), originally Bertrand Meyer's: software entities should be open for extension but closed for modification, achieved through abstraction and polymorphism. Liskov Substitution Principle (LSP), Barbara Liskov's 1987 contribution: subtypes must be substitutable for their base types without breaking client expectations. Interface Segregation Principle (ISP): clients should not be forced to depend on methods they do not use — prefer many specific interfaces over few general ones. Dependency Inversion Principle (DIP): high-level modules should not depend on low-level modules; both should depend on abstractions. SOLID is among the most-taught object-oriented design principles, while drawing critique for being over-applied in contexts (functional programming, simple CRUD applications) where the principles add complexity without benefit.

Originators

Robert C. Martin (acronym and synthesis); Bertrand Meyer (OCP origin); Barbara Liskov (LSP origin) high

Year / Decade

1990s individual articulation; 2000 (Martin's 'Design Principles and Design Patterns' article); 2002 (Agile Software Development synthesis) high

Primary sources

Martin, R.C. (2000). 'Design Principles and Design Patterns' (objectmentor.com), Martin, R.C. (2002). Agile Software Development, Principles, Patterns, and Practices, Meyer, B. (1988). Object-Oriented Software Construction (OCP), Liskov, B. (1987). 'Data Abstraction and Hierarchy' (LSP) high

Core components

Primary use case

Object-oriented design education and practice; code review heuristics and refactoring guidance; foundation for testable application design; widely-cited reference in software craftsmanship and clean-code communities; basis for many static analysis and code-quality rules.

Common criticisms

Lineage

Siblings
DRY, KISS, YAGNI, Clean Architecture