Skip to content

gaurav-js-dev/design-patterns-practice

Repository files navigation

Design Pattern & Principles

This repo covers some of the Gang of Four design patterns. Here's the full list of what is covered in this repo:

  • SOLID Design Principles: Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle

  • Structural Design Patterns: Bridge, Composite, Decorator, Façade

  • Behavioral Design Patterns: Command, Mediator, Strategy, Template Method

Repo and Folder structure

  • There is a dedicated folder for each pattern/principle and this folder contains few files. If there file ending with fixed or file named as ExampleWithPattern.js contains optimized code and other file contains the code before refactoring or when pattern was not applied. If there is just one js file then it is the actual optimized code. A folder may contain more than one example this way.

  • Each Folder also contains a readme file which explains why & how the design pattern is applied to the existing code and what and how are the advantages gained after applying the principle to the existing code. It also explains code snippets line by line.

Usage

  • There are folders created for each design pattern.After cloning this repo to run the code first cd into desired folder with below command.
    $ cd facade
  • After selecting the desired design pattern folder as current working directory please execute node as project is based on Javascript. Enter the file name after node and hit enter you will see the output. To understand output please refer to readme file with code follow along in it.
    $ node Buffer.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published