This repository contains sample source code implementations of various design patterns.
The purpose is to provide a clean and practical reference for developers who want to understand how design patterns can be applied in real projects.
All examples are organized by categories β design patterns β programming languages.
.
βββ Creational/ # Khα»i tαΊ‘o (Creational Patterns)
β βββ Singleton/
β βββ FactoryMethod/
β βββ AbstractFactory/
β
βββ Structural/ # CαΊ₯u trΓΊc (Structural Patterns)
β βββ Adapter/
β βββ Decorator/
β βββ Proxy/
β
βββ Behavioral/ # HΓ nh vi (Behavioral Patterns)
βββ Observer/
βββ Strategy/
βββ Command/
| Pattern | Link |
|---|---|
| Singleton | View Code |
| Factory Method | View Code |
| Abstract Factory | View Code |
| Builder | View Code |
| Prototype | View Code |
| Pattern | Link |
|---|---|
| Adapter | View Code |
| Bridge | View Code |
| Composite | View Code |
| Decorator | View Code |
| Facade | View Code |
| Flyweight | View Code |
| Proxy | View Code |
| Pattern | Link |
|---|---|
| Chain of Responsibility | View Code |
| Command | View Code |
| Iterator | View Code |
| Mediator | View Code |
| Memento | View Code |
| Observer | View Code |
| State | View Code |
| Strategy | View Code |
| Template Method | View Code |
| Visitor | View Code |
Each folder contains subfolders for supported programming languages (e.g.,
Java,Php, ...).
- Navigate to the pattern folder you want to study.
- Choose the programming language (e.g.,
Java,Php). - Open the source code files.
- Compile and run them locally.
Example:
cd Creational/Singleton/Java
javac *.java
java MainConcepts are based on Refactoring.Guru β Design Patterns. This repository only provides source code samples, not detailed explanations.
You are welcome to contribute by:
- Adding new design pattern implementations
- Supporting more programming languages
- Improving code quality
Released under the MIT License. You can freely use, modify, and share the code with attribution.