Add creational patterns, Interpreter; remove scripts; update README

This commit is contained in:
2026-06-13 16:22:13 +00:00
parent a5beb61425
commit 2f684bf3d7
38 changed files with 435 additions and 350 deletions

View File

@@ -1,6 +1,8 @@
# GoF Design Patterns in Java
Complete runnable Java 17 implementations of all 23 Gang of Four design patterns. Each pattern has a dedicated article at [ankurm.com](https://ankurm.com/gof-design-patterns-java/) with a UML diagram, step-by-step explanation, and console output.
Complete runnable Java 17 implementations of all 23 Gang of Four design patterns.
Each pattern has a dedicated article at [ankurm.com](https://ankurm.com/gof-design-patterns-java/)
with a UML diagram, step-by-step explanation, and console output.
## Structure
@@ -41,27 +43,16 @@ design-patterns/
## Run any pattern
```powershell
# Windows (PowerShell)
$JAVAC = 'C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\javac.exe'
$JAVA = 'C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java.exe'
& $JAVAC 03-behavioral/strategy/*.java -d out/strategy
& $JAVA -cp out/strategy strategy.Main
```
```bash
# Linux / macOS
# Linux / macOS / Git Bash (Windows)
javac 03-behavioral/strategy/*.java -d out/strategy
java -cp out/strategy strategy.Main
```
## Run all behavioral patterns (Windows)
Double-click `RUN-behavioral.bat` or run in PowerShell:
```powershell
powershell -ExecutionPolicy Bypass -File run-behavioral.ps1
```cmd
REM Windows Command Prompt
javac 03-behavioral\strategy\*.java -d out\strategy
java -cp out\strategy strategy.Main
```
## Articles