Skip to content

Latest commit

 

History

History
45 lines (36 loc) · 1.37 KB

README.md

File metadata and controls

45 lines (36 loc) · 1.37 KB

Design Patterns

Examples of Typescript implementation of examples of design patterns described in the "Head First Design Patterns" by Eric Freeman, Elisabeth Robson, Bert Bates, and Kathy Sierra.

OO design principles

  • Favour composition over inheritance
  • Encapsulate what varies
  • Program to interfaces, not implementations
  • Strive for loosely coupled designs between objects that interact
  • Depend on abstractions. Do not deppend on concrete classes
  • Talk only to your friends.
  • Don't call us, we'll call you
  • A class shuld have only one reason to change

Design patterns

  1. Strategy
  2. Observer
  3. Decorator
  4. Factory
  5. Singleton
  6. Command
  7. Adapter and facade
  8. Template
  9. Iterator and composite
  10. State
  11. Compound
  12. MVC

Other design patterns

  • Bridge
  • Chain of Responsibility
  • Mediator
  • Builder
  • Prototype
  • Memento
  • Flyweight
  • Visitor
  • Proxy

Catalog of design patterns

Full catalog of design patterns with examples