Skip to content

SOLID Principles

I need to...

I need to... Guide Summary
Understand what SOLID means and why it matters SOLID Overview What SOLID means, why it matters, and when to learn each principle across career stages.
Learn when a class has too many responsibilities Single Responsibility Principle When designing classes, modules, or functions -- especially when you notice code becoming harder to test, change, or understand.
Refactor code toward single responsibility SRP in Practice Practical refactoring strategies for Single Responsibility Principle — when to split, detection patterns, and when NOT to split.
Make code extensible without modification Open/Closed Principle When building systems that need to support new features without modifying existing, tested code. Especially critical in libraries, frameworks, and plugin architectures.
Implement plugin systems and middleware OCP in Practice Practical OCP patterns — plugin systems, middleware, data-driven configuration, and when to apply or skip OCP.
Understand when subtypes break substitutability Liskov Substitution Principle When designing inheritance hierarchies, implementing interfaces, or using polymorphism. LSP ensures subtypes don't break expectations set by base types.
Detect and fix LSP violations LSP in Practice Detecting and fixing LSP violations — contract testing, covariance/contravariance, composition over inheritance, and refactoring patterns.
Avoid forcing clients to depend on unused methods Interface Segregation Principle When designing interfaces, APIs, or contracts that multiple clients will implement. ISP prevents forcing clients to depend on methods they don't use.
Refactor fat interfaces into role interfaces ISP in Practice Practical ISP patterns — adapter pattern for third-party interfaces, interface inheritance, granularity decisions, and refactoring fat interfaces.
Depend on abstractions instead of concrete classes Dependency Inversion Principle When designing layered architectures, building testable systems, or decoupling high-level business logic from low-level implementation details.
Implement dependency injection and IoC containers DIP in Practice Practical DIP patterns — IoC containers, constructor/setter/interface injection, Ports and Adapters architecture, and testing with DIP.
Apply SOLID to microservices and component architecture SOLID in Modern Architecture Applying SOLID principles to microservices, component-based frontends, API design, and event-driven architecture.
Know when to bend SOLID rules pragmatically SOLID vs Pragmatism When to bend SOLID rules — balancing principles with YAGNI, KISS, and pragmatic decision-making based on project context.
Recognize common SOLID violations SOLID Anti-Patterns Common SOLID anti-patterns — God Object, Modification Cascade, Refused Bequest, Interface Bloat, Service Locator, and more.
Detect principle violations during code review SOLID Code Smells During code reviews, use these smells to detect SOLID violations early.
Make daily development decisions using SOLID Best Practices Decision Framework Daily SOLID decision framework — decision tree, apply-or-skip matrix, security and performance best practices, and anti-pattern avoidance checklist.
Find authoritative books and articles Code Reference Map