This repository contains the SOLID principles details and code examples written in JavaScript and Typescript.
SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable.
The SOLID principles are:
There should never be more than one reason for a class to change. In other words, every class should have only one responsibility.
Software entities should be open for extension, but closed for modification.
Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it. See also design by contract.
Many client-specific interfaces are better than one general-purpose interface.
Depend upon abstractions, not concretions.
Principle | Information |
---|---|
Single responsibility | 📄 |
Open–Closed | 📄 |
Liskov substitution | 📄 |
Interface segregation | 📄 |
Dependency inversion | 📄 |