February 23, 2020

SOLID design pattern

The SRP states that a class should have only a single reason to change. This responsibility should be entirely encapsulated by the class. The services of the class should be narrowly aligned with that responsibility.

The Open-Closed Principle (OCP) states that software entities (classes, modules, methods, etc.) should be open for extension, but closed for modification.

LSP – Liskov Substitution Principle  states that objects of a superclass should be replaceable with objects of its subclasses without breaking the application.”
LSP states that any child class should only extend or modify behavior defined in the parent class, NOT introduce new behavior.


High level modules should not depend on low level modules; both should depend on abstractions. Abstractions should not depend on details.  Details should depend upon abstractions.