api: "YAML JSON TOON Database" version: 1.0.0 format: json dataset: slug: solid-principles title: "SOLID Principles" description: "Five design principles for writing maintainable object-oriented code." category: "Design Patterns" category_slug: design-patterns tags: "design-patterns,solid,oop,software-engineering" view_count: 0 data [5]{principle,description,example}: "S - Single Responsibility","A class should have only one reason to change.","Separate UserAuth from UserProfile." "O - Open/Closed","Open for extension, closed for modification.","Add new payment types without changing existing processor." "L - Liskov Substitution","Subtypes must be substitutable for their base types.","A Square should not extend Rectangle if width=height invariant breaks." "I - Interface Segregation","Prefer many small client-specific interfaces over one large interface.","Separate Printer and Scanner interfaces." "D - Dependency Inversion","Depend on abstractions, not concrete implementations.","Controller depends on ILogger interface, not FileLogger."