Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

πŸŽ“ Certifications
πŸ€– Artificial Intelligence
☁️ Cloud and Infrastructure
πŸ’Ύ Data and Databases
πŸ’Ό Professional Skills
🎯 Programming and Development
πŸ”’ Security and Networking
πŸ“š Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
Β© 2026 CheatGridβ„’. All rights reserved.
Privacy PolicyTerms of UseAboutContact

SOLID Principles Cheat Sheet

SOLID Principles Cheat Sheet

Back to Software Engineering
Updated 2026-05-28
Next Topic: System Design Fundamentals Cheat Sheet

SOLID is an acronym for five object-oriented design principles introduced by Robert C. Martin (Uncle Bob) that guide developers toward creating maintainable, scalable, and flexible software systems. These principles address dependency management and separation of concerns, helping to reduce coupling, increase cohesion, and make code easier to test, modify, and extend. While rooted in object-oriented programming, SOLID has proven relevant across paradigms β€” from microservices architecture to React components to Rust traits. Understanding when and how to apply these principles pragmatically, without over-engineering, is key to writing professional-grade code that withstands change.

What This Cheat Sheet Covers

This topic spans 14 focused tables and 108 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core SOLID PrinciplesTable 2: Single Responsibility Principle (SRP) β€” DetailsTable 3: Open/Closed Principle (OCP) β€” DetailsTable 4: Liskov Substitution Principle (LSP) β€” DetailsTable 5: Interface Segregation Principle (ISP) β€” DetailsTable 6: Dependency Inversion Principle (DIP) β€” DetailsTable 7: Common Violations and Code SmellsTable 8: Benefits of SOLID PrinciplesTable 9: SOLID and Design PatternsTable 10: Practical Considerations and TradeoffsTable 11: SOLID in TestingTable 12: SOLID in Modern ContextsTable 13: Relationship to Other Principles and FrameworksTable 14: Historical Context and Authorship

Table 1: Core SOLID Principles

Each principle attacks a different failure mode in software design: SRP stops class sprawl, OCP prevents regression-causing rewrites, LSP enforces reliable inheritance, ISP shrinks bloated interfaces, and DIP inverts rigid dependencies. Together they form a coherent strategy for keeping codebases adaptable.

PrincipleExampleDescription
Single Responsibility Principle (SRP)
class User { login() {...} }
class UserRepository { save() {...} }
β€’ A class should have one and only one reason to change
β€’ responsible to one actor (one business function or stakeholder).
Open/Closed Principle (OCP)
interface Shape { area(): number }
class Circle implements Shape {...}
β€’ Modules should be open for extension but closed for modification
β€’ add features via new code, not by changing existing tested code.
Liskov Substitution Principle (LSP)
Rectangle r = new Square();
r.setWidth(5); r.setHeight(10);
β€’ Subtypes must be substitutable for their base types without altering program correctness
β€’ subclasses must honor parent contracts and not surprise callers.

More in Software Engineering

  • Software Resilience Patterns Cheat Sheet
  • System Design Fundamentals Cheat Sheet
  • _Dependency_Injection_Patterns
  • Database Migration Strategies for Development Teams Cheat Sheet
  • Integration Testing Patterns and Strategies Cheat Sheet
  • Software Architecture Fitness Functions Cheat Sheet
View all 47 topics in Software Engineering