Skip to content

pncsoares/javascript-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Design Patterns

Design patterns written in JavaScript and TypeScript.

Definition

A software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

๐Ÿ‘† Source

In my opinion, this defines very well what a design pattern is.

Advantages of using them

  • Promote easier changes
  • Turns the objects reusable
  • Keeps objects small and specialized

Types

  • Creational patterns
  • Structural patterns
  • Behavioral patterns
  • Concurrency patterns

Code examples

Type Name Information
Creational patterns Builder Go to detail ๐Ÿ“„
Creational patterns Singleton Go to detail ๐Ÿ“„
Structural patterns Facade Go to detail ๐Ÿ“„
Behavioral patterns Command Go to detail ๐Ÿ“„
Behavioral patterns Null Object Go to detail ๐Ÿ“„

Another design patterns that I will add in the future:

  • Factory
  • Observer
  • Decorator
  • Strategy
  • Adapter
  • Iterator
  • Proxy
  • Composite
  • Bridge

Setup

Clone repository

Create and go to the directory where you want to place the repository

  cd my-directory

Clone the project

  git clone https://github.com/pncsoares/javascript-design-patterns.git

Go to the project directory

  cd javascript-design-patterns

License

MIT

Releases

No releases published

Packages

No packages published