A brief look at the factory pattern, what’s its used for and its implementation in JavaScript.

Organizing code is going to save us from a lot of pain. Using the features of Object Oriented programming, we can employ certain design patterns to achieve better readability, reduce redundancy and create abstractions, if needed. One such pattern is the factory pattern.

The factory pattern is a type of Object Oriented pattern which follows the DRY methodology. As the name suggests, object instances are created by using a factory to make the required object for us.

#javascript #design-pattern

JavaScript Object Oriented Patterns: Factory Pattern
2.25 GEEK