This repository is a small library which contains Java based real-world examples of many popular design patterns mentioned in the Gang of Four Book.
☝️ Note that this project is meant to be used for learning and researching purposes only and it is not meant to be used for production.*
A data pattern is a
B
- Beginner, A
- Advanced
- Creational
A
Abstract Factory - set/get/update/clear bits, multiplication/division by two, make negative etc.B
Builder PatternB
Factory Method - classic and closed-form versionsB
Singleton (trial division method)B
Object Pool - calculate the Greatest Common Divisor (GCD)B
Prototype (LCM)
- Structural
B
Adapter Pattern - product of multiple setsB
Bridge Pattern - random permutation of a finite sequenceA
Composite Pattern - all subsets of a set (bitwise and backtracking solutions)A
Decorator Pattern (with and without repetitions)A
Facade Pattern (with and without repetitions)A
Flyweight Pattern (LCS)A
Proxy Pattern
- Behavioral
B
Chain of Responsibility - number of positions at which the symbols are differentA
Command Pattern - minimum edit distance between two sequencesA
Iterator Pattern (KMP Algorithm) - substring search (pattern matching)A
Mediator Pattern - substring search (pattern matching)A
Observer Pattern - substring searchA
State PatternA
Strategy PatternA
Template MethodA
Visitor Pattern