Giter VIP home page Giter VIP logo

design-patterns-in-typescript's Introduction

Design Patterns In Angular

  • Run npm install to install the needed npm packages
  • Run ng serve for a dev server. Navigate to http://localhost:4201/
  • Run ng generate module singleton --route singleton --module app.module to create a feature module with routing

Creational Patterns

Abstract Factory

  • short description: create a related object family
  • applicability: system is capsulated of the creation & composition of its models
  • visual resource: https://refactoring.guru/design-patterns/abstract-factory
  • expandability: concrete factories as singletons, factory method for creation of concrete objects, for too much objects you can use the Prototype Pattern
UML

Abstract Factory

UML: example of this repo

Abstract Factory Example

Singleton

UML

Singleton

UML: example of this repo

Singleton Example

Prototype (Clone)

  • short description: clone/copy a component
  • applicability: runtime specification of objects (dynamic loading), to many different objects for factories
  • visual resource: https://refactoring.guru/design-patterns/prototype
  • expandability: implementation of prototype manager (hold all prototype instances), deep-cloinig,
UML

Prototype

UML: example of this repo

Prototype Example

Builder

UML

Builder

UML: example of this repo

Example

Factory Method (Virtual Constructor)

UML

Factory Method

UML: example of this repo

Factory Method Example

Structural Patterns

Adapter (Wrapper)

UML

Adapter

UML: example of this repo

Adapter Example

Bridge

UML

Bridge

UML: example of this repo

Bridge Example

Composite (Object Tree)

UML

Composite

UML: example of this repo

Composite Example

Decorator (Wrapper)

UML

Decorator

UML: example of this repo

Decorator Example

Facade

UML

Facade

UML: example of this repo

Facade Example

Flyweight (Cache)

UML

Flyweight

UML: example of this repo

Flyweight Example

Proxy

UML

Proxy

UML: example of this repo

Proxy Example

Mediator

UML

Mediator

UML: example of this repo

Mediator Example

Iterator

UML

Iterator

UML: example of this repo

Iterator Example

Memento

UML

Memento

UML: example of this repo

Memento Example

Strategy

UML

Strategy

UML: example of this repo

Strategy Example

Command

UML

Command

UML: example of this repo

Command Example

Observer

UML

Observer

UML: example of this repo

Observer Example

Visitor

UML

Visitor

UML: example of this repo

Visitor Example

State

UML

State

UML: example of this repo

State Example

Template Method

  • short description: defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure
  • visual resource: https://refactoring.guru/design-patterns/state
UML

Template Method

UML: example of this repo

Template Method Example

Chain Of Responsibility

  • short description: pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain
  • visual resource: https://refactoring.guru/design-patterns/state
UML

Chain of Responsibility Method

UML: example of this repo

Chain of Responsibility Method Example

Resources

design-patterns-in-typescript's People

Contributors

bikashdaga avatar itchimonji 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.