- How to execute the examples
- Strategy Pattern
- Observer Pattern
- Decorator Pattern
- Factory Pattern
- Command Pattern
These examples was build with Typescript and Deno, so Deno is required to execute these codes.
According Head First - Design Pattern:
the Strategy Pattern defines a family of algorithms, enncapsulates each onde, aand make them interchangeable. Strategy lets the algorithm vary idependently from clients that use it.
Strategy Pattern make objects open do change inside the runtime. So, instead to rewrite a class of an object, just write its behavior and change the obbject bbehavior.
Inside strategy-pattern/ directory, you can see two implementation examples of Strategy Pattern.