Use when you want to select between different algorithms in the process of task resolving. So basically all that you need to realize this pattern are strategies (each of them in the separated component/class, but with the same interface) and strategy selector (decides what strategy is more effective at the moment and uses it).
Programming Patterns. Facade, Adapter, Decorator
The main idea is a creation of simplified interface to application functionality. Basically, when you create components of your application the interfaces of these ones can be really complicated for outside usage. So to resolve this problem and provide easy-to-go solution, you can use Façade.
Programming Patterns. Module, Singleton, Factory
“Module” pattern is usually used to encapsulate some logic inside the component and return only the part that supposed to be public. It brings the encapsulation that’s natively not supported in JavaScript.
Programming Patterns. SOLID principle
Let’s start from SOLID principles to get the basic understanding of this stuff. There are 5 principles: – Single responsibility; – Open-closed; – Liskov substitution; – Interface segregation; – Dependency inversion;
Programming Patterns. Introduction
Patterns are the part of programming that needs to be studied regardless of the specific language, so that doesn’t matter what exactly you use: C, C++, C# or JavaScript, each of them uses some of the programming patterns, but there is the most interesting point how to implement the concept according to language specifics.