Programming - SOLID Principles of Object Oriented Design

SOLID: The First 5 Principles of Object Oriented Design

More detail here: https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design

Single-responsibility Principle

A class should have one and only one reason to change, meaning that a class should have only one job

Open-Closed Principle

Objects or entities should be closed for extension but closed for modification

Meaning that a class should be extendible without modifying the class itself.

Liskov Substitution Principle

Let q(x) be a property provable about objects x of Type T. Then q(y) should be provable for objects y of type S where S is a subtype of T

In English, this means that every subclass should be substitutable for their base or parent class.

Interface Segregation Principle

A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.

Dependency Inversion Principle

Entities must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but they should depend on abstractions.