All Projects → khaled-hamam → design-patterns-explained

khaled-hamam / design-patterns-explained

Licence: CC-BY-SA-4.0 license
Explanation for most of the well-known design patterns with examples and figures.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to design-patterns-explained

Design Patterns For Humans
An ultra-simplified explanation to design patterns
Stars: ✭ 32,376 (+179766.67%)
Mutual labels:  design-patterns, principles, software-engineering
notes
My personal tutorials and notes.
Stars: ✭ 34 (+88.89%)
Mutual labels:  design-patterns, principles, software-engineering
java-design-patterns-web
Java Design Patterns website at https://java-design-patterns.com
Stars: ✭ 81 (+350%)
Mutual labels:  design-patterns, principles
Ui Design
🔥 A curated list of useful resources related to User Interface Design
Stars: ✭ 423 (+2250%)
Mutual labels:  design-patterns, principles
Designpatternslibrary
A comprehensive design patterns library implemented in C#, which covers various design patterns from the most commonly used ones to the lesser-known ones. Get familiar with and learn design patterns through moderately realistic examples.
Stars: ✭ 485 (+2594.44%)
Mutual labels:  design-patterns, principles
enterprise-applications-patterns
Collection of enterprise application patterns
Stars: ✭ 17 (-5.56%)
Mutual labels:  design-patterns, software-engineering
Ruby.fundamental
📚 Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading. Repo for website https://github.com/khusnetdinov/betterdocs
Stars: ✭ 391 (+2072.22%)
Mutual labels:  design-patterns, principles
Design Patterns And Principles
A collection of a number of design patterns and principles written in Kotlin
Stars: ✭ 56 (+211.11%)
Mutual labels:  design-patterns, software-engineering
When Ts
When: recombinant design pattern for state machines based on gene expression with a temporal model
Stars: ✭ 112 (+522.22%)
Mutual labels:  design-patterns, software-engineering
Jwave
A Discrete Fourier Transform (DFT), a Fast Wavelet Transform (FWT), and a Wavelet Packet Transform (WPT) algorithm in 1-D, 2-D, and 3-D using normalized orthogonal (orthonormal) Haar, Coiflet, Daubechie, Legendre and normalized biorthognal wavelets in Java.
Stars: ✭ 174 (+866.67%)
Mutual labels:  design-patterns, software-engineering
swe
Examples and exercises used during Software Engineering course
Stars: ✭ 18 (+0%)
Mutual labels:  design-patterns, software-engineering
Design Patterns Python
💻 Padrões de Projeto em Python
Stars: ✭ 246 (+1266.67%)
Mutual labels:  design-patterns, software-engineering
Java Design Patterns
Design patterns implemented in Java
Stars: ✭ 71,923 (+399472.22%)
Mutual labels:  design-patterns, principles
tg
Trident Genesis
Stars: ✭ 14 (-22.22%)
Mutual labels:  software-engineering
betterdocs
📚 Web version of https://github.com/khusnetdinov/ruby.fundamental repo - Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading.
Stars: ✭ 25 (+38.89%)
Mutual labels:  design-patterns
design-patterns-cpp14
🙏 Design patterns implemented in C++14
Stars: ✭ 35 (+94.44%)
Mutual labels:  design-patterns
express-mvc-pattern
Example nodejs using express implementation design pattern using mvc architecture.
Stars: ✭ 52 (+188.89%)
Mutual labels:  design-patterns
JavaScript-design-patterns
Examples of popular design patterns in JavaScript
Stars: ✭ 41 (+127.78%)
Mutual labels:  design-patterns
Java-design-patterns
Java Design patterns.
Stars: ✭ 49 (+172.22%)
Mutual labels:  design-patterns
NamingThings
Content on tips, tricks, advice, practices for naming things in in software/technology
Stars: ✭ 31 (+72.22%)
Mutual labels:  principles

Design Patterns Explained.


GitHub Repo stars GitHub Workflow Status GitHub

This is intended to be a collection of most of the well-known design patterns, with explanation, examples, illustrations, and everything you need to learn and understand design patterns without the trivial examples usually found while explaining the patterns.

Introduction

Design patterns are gaining more popularity each day, but the problem is that they are often misused, either by putting them outside of their intended context, or by putting them in the right position, with the correct usage, but before the problem is frequent or big enough to deserve implementing a known design pattern which will often end by you over-engineering the code base and increasing its complexity.

One of the causes that will result in misusing the patterns is that most of the examples found online to learn patterns are often very simple and trivial, that you won't be able to understand when to use the pattern or why it existed in the first place.

In this collection of patterns I'll try as possible to stay away of any ducks and pizzas examples, and write real cases while explaining when to use the pattern, and what problems implementing the pattern will introduce.

Consuming the Content

There's no correct way to consume this content, you can go through the patterns with any order, and if a pattern uses a concept from another pattern, or the example make use of another pattern, I'll make sure to mention it.

I can recommend to read and understand the SOLID Principles before moving to any of the patterns.

You can choose any of the patterns from the patterns catalogue.

Keep in Mind

  • Design patterns can be easily misused, so make sure to fully understand the pattern, its use cases, and what is the problem it is trying to solve.
  • Design patterns don't have one way for implementation, you can change the implementation, the components, and even mix between the patterns as you wish.
  • Design patterns aren't the ultimate solution to a problem, they may even introduce a few problems of their own due to their limitations, so implement only what you need, and feel free to extend them with what you see fits your context.
  • I'll try as possible to avoid trivial examples, but I may not be able to make real-life examples for all the patterns, so feel free to contribute with a better example, or try searching one of the learning sources for better examples.
  • Please be careful as this code is not production quality by any means, avoid copying and pasting or using the code in the examples as is, as it is not intended to be used in production code.

Why TypeScript

As you can see, all the examples and tests are written in TypeScript. There's no particular reason for me to use TypeScript while explaining Design Patterns other than I'm familiar with it.

Some of the patterns heavily depend on certain language features which may not be found in TypeScript, or can easily be mis-implemented without a certain feature, it may behave the same, but sometimes it will lack the complete features or benefits the same pattern will provide in other languages.

I will try as possible to be clear on where TypeScript falls short, but maybe in the future I'll implement the examples in other languages.

Finally, feel free to contribute to the code with other examples or even examples written in other languages.

How to Use the Tests

You'll need this only if you want to play with the code and try new things, or if you want to contribute to the project.

# clone the repository
$ git clone https://github.com/khaled-hamam/design-patterns-explained.git

# Installing the needed dependencies
$ npm install

# OPTIONAL: Run Compilation for Error Checking
$ npm run build

# OPTIONAL: Run Compilation on Watch Mode
$ npm run build:watch

# Running the tests
$ npm test

# Running the tests in watch mode
$ npm run test:watch

# Running tests for a certain pattern
$ npm run test <pattern-folder-name>

# Running Linting on Markdown Files
$ npm run lint

# Auto Fix basic errors in Markdown
$ npm run lint -- --fix

# Format files with prettier
$ npm run format

Learning Sources

  1. Design Patterns: Elements of Reusable Object-Oriented Software
  2. Design Patterns Library | Pluralsight
  3. Refactoring.guru
  4. SourceMaking.com
  5. Wikipedia
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].