In this article, we will see what are design patterns and a bunch of design patterns in JavaScript.
Design patterns are solutions to the problems that commonly occur in software engineering. They solve the problems that occur in a particular pattern or often.
These patterns are developed over the time by software engineers as an when they had faced challenges during their programming careers. .
As they solve the common occurring problems, following the patterns helps in having better code readability and efficient logical flow. Knowing the patterns will help you to solve different types of problem that occurs during designing the system using the fundamentals of programming.
They are the tried and tested solutions to the common occurring problems and there are roughly around 22 different design patterns as of now, but we are going to learn the patterns that are specific to the web development or front-end development.
When you use the design pattern’s name during the discussions, everyone gets the idea about the problem you are trying to solve, as it refers the common occurring issue.
For example, if you say I am using Singleton pattern, that will indicate that you wanted to have a single instance of the object.
The patterns that we are going to learn here, some of them are specific to the JavaScript programming language and some to the Reactjs UI library.
- Singleton design pattern in JavaScript
- Observer design pattern in JavaScript
- Circuit breaker in JavaScript
- Proxy design pattern in JavaScript
- Provider design pattern for Reactjs
- Builder design pattern in JavaScript
- Prototype design pattern in JavaScript
- Iterator design pattern in JavaScript
- Higher-order component pattern in React
- Container and Presentational pattern in React
Understanding the design patterns are essential for the frontend system design interviews or in-general web development interviews.