Skip to content

Instantly share code, notes, and snippets.

@guiliredu
Created October 11, 2018 17:22
Show Gist options
  • Save guiliredu/45e35574bae108e64ab9d7d27403204d to your computer and use it in GitHub Desktop.
Save guiliredu/45e35574bae108e64ab9d7d27403204d to your computer and use it in GitHub Desktop.
SOLID Principles

Solid Principles

Single Responsibility Principle

A class should have only one job.

Open-Closed Principle

Software entities (Classes, modules, functions) should be open for extension, not modification.

Liskov Substitution Principle

A sub-class must be substitutable for its super-class

Interface Segregation Principle

Make fine grained interfaces that are client specific. Clients should not be forced to depend upon interfaces that they do not use.

Dependency Inversion Principle

Dependency should be on abstractions not concretions: A. High-level modules should not depend upon low-level modules. Both should depend upon abstractions. B. Abstractions should not depend on details. Details should depend upon abstractions.

Resource: https://blog.bitsrc.io/solid-principles-every-developer-should-know-b3bfa96bb688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment