Skip to content

mikiPP/design-patterns

Repository files navigation

Design Patterns Repository

This repository contains examples and explanations of various design patterns. Design patterns are categorized into three types:

  1. Creational Patterns
  2. Structural Patterns
  3. Behavioral Patterns

Each type has its own folder with detailed explanations and examples of the design patterns it contains.

Creational Patterns

Creational patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code. Examples include:

  • Singleton
  • Factory Method
  • Abstract Factory
  • Builder
  • Prototype

Structural Patterns

Structural patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient. Examples include:

  • Adapter
  • Composite
  • Proxy
  • Flyweight
  • Facade
  • Bridge
  • Decorator

Behavioral Patterns

Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects. Examples include:

  • Chain of Responsibility
  • Command
  • Iterator
  • Mediator
  • Memento
  • Observer
  • State
  • Strategy
  • Template Method
  • Visitor

Each pattern has its own folder with a detailed README file explaining the pattern, its use cases, and examples.

References

This repository was created using information and examples from the following sources:

To run the code

First install dependecies with npm install, then run npx tsx [file-route] for example: npx tsx creational/builder/builder.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors