Design Patterns Explained
  • Getting Started
  • SOLID Principles
    • Single Responsibility Principle
    • Open / Closed Principle
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle
  • Design Patterns
    • Creational Patterns
      • Abstract Factory Pattern
      • Builder Pattern
      • Factory Pattern
      • Prototype Pattern
      • Singleton Pattern
    • Behavioral Patterns
      • Chain Of Responsibility Pattern
      • Command Pattern
      • Interpreter Pattern
      • Iterator Pattern
      • Mediator Pattern
        • Example 1
      • Memento Pattern
      • Observer Pattern
      • State Pattern
      • Strategy Pattern
        • Example 1
      • Template Method Pattern
      • Visitor Pattern
    • Structural Patterns
      • Adapter Pattern
      • Bridge Pattern
      • Composite Pattern
      • Decorator Pattern
      • Facade Pattern
      • Flyweight Pattern
      • Proxy Pattern
  • Roadmap
Powered by GitBook
On this page

Was this helpful?

SOLID Principles

PreviousGetting StartedNextSingle Responsibility Principle

Last updated 4 years ago

Was this helpful?

SOLID Principles

SOLID is an acronym for five design principles for object oriented code, although SOLID can be used and adapted as principles for any form of software development.

The term SOLID was introduced by Robert C. Martin, and it's considered to be the base principles which its violation can cause many problems that can be solved using one of the design patterns widely known (of course not every form of violation can have a solution in a form of a design pattern).

To fully understand the design patterns, why are they made? and what problems do they solve? you should first fully grasp the five SOLID principles:

After applying the SOLID principles to your code base, the code should be decoupled, easy to reuse, easy to extend (as we are always looking for low coupling, and high cohesion), but be aware of over-engineering without a clear vision of why you're choosing to follow these principles, by the end of the day they're only principles, not rules, they can be ignored in some cases for clear reasons and better solutions.

Single Responsibility Principle
Open-Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle