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 | 📄 |
Technology | Short name | Documentation |
---|---|---|
JavaScript | JS | 📎 |
TypeScript | TS | 📎 |
Create and go to the directory where you want to place the repository
cd my-directory
Clone the project
git clone https://github.com/pncsoares/javascript-solid-principles.git
Go to the project directory
cd javascript-solid-principles
Feel free to contribute and fix something that is wrong or could be better! Issues and pull requests are welcome.
To do so please create a new branch, change or add what you want and then create a Pull Request to branch main
and add me as reviewer.
Thanks 🙏
MIT