Git Product home page Git Product logo

design-patterns-ts's Introduction

Design Patterns with TypeScript

A design pattern is a general reusable solution to a common problem that occurs in software design. It is a template that describes how to solve a particular problem that can be adapted to fit various situations.

Design patterns are usually created to address specific problems in software development and provide a standard solution that can be used across different programming languages and frameworks. They are not actual code but rather a conceptual framework or approach that helps developers organize and structure their code in a more efficient and scalable way.

Design patterns are classified into three main categories: creational patterns, structural patterns, and behavioral patterns. Creational patterns deal with the process of object creation, structural patterns deal with object composition and relationships, and behavioral patterns focus on how objects interact and communicate with each other.

Examples of popular design patterns include the Singleton pattern, Factory pattern, Adapter pattern, Observer pattern, and Decorator pattern. By using these patterns, developers can write more maintainable and reusable code that is easier to understand, modify, and extend over time.

Requisites

In order to follow up with this repo, you would like to have a strong knowledge in:

  • JavaScript and TypeScript
  • Object Oriented Programming
  • Software development in general

Installation

  1. Fork this repo
  2. Clone this repo: git clone [your forked repo] in a local environment
  3. Initialize npm: npm init -y
  4. Install all the necessary dependencies: npm install
  5. Run the file you need with the command start. For example: npm run start -- creational/factory/non-example.ts

The two hypens means that a param will be added next, which will be the path of the file you are gonna run

Index

Along this repo, we are going to discover the most common design patterns, their use cases and examples written in TypeScript.

Creational Patters

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

Structural Patterns

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

Behavioral Patters

  • Chain of responsability
  • Iterator
  • Memento
  • State
  • Template method
  • Command
  • Mediator
  • Observer
  • Strategy
  • Visitor

Inspiration

This repo has been inspired in this article, with the purpose to add more example and use cases.

design-patterns-ts's People

Contributors

irvingvjuarez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.