Excerpts and code-snippets from Addy Osmani's Learning Javascript Design Patterns
-
Creational design patterns focus on handling object creation mechanisms where objects are created in a manner suitable for the situation we're working in. The basic approach to object creation might otherwise lead to added complexity in a project whilst these patterns aim to solve this problem by controlling the creation process.
-
Some of the patterns that fall under this category are: Constructor, Factory, Abstract, Prototype, Singleton and Builder.
-
Structural patterns are concerned with object composition and typically identify simple ways to realize relationships between different objects.
-
They help ensure that when one part of a system changes, the entire structure of the system doesn't need to do the same.
-
They also assist in recasting parts of the system which don't fit a particular purpose into those that do.
-
Patterns that fall under this category include: Decorator, Facade, Flyweight, Adapter and Proxy.
-
Behavioral patterns focus on improving or streamlining the communication between disparate objects in a system.
-
Some behavioral patterns include: Iterator, Mediator, Observer and Visitor.
- Constructor Pattern
- Module Pattern
- Revealing Module Pattern
- Singleton Pattern
- Observer Pattern
- Mediator Pattern
- Prototype Pattern
- Command Pattern
- Facade Pattern
- Factory Pattern
- Mixin Pattern
- Decorator Pattern
- Flyweight Pattern
- MVC(Model-View-Controller)
- MVP(Model-View-Presenter)
- MVVM(Model-View-ViewModel)