Add all 23 GoF design pattern implementations (2026-06-13)

This commit is contained in:
Ankur
2026-06-13 21:44:56 +05:30
commit a5beb61425
106 changed files with 2977 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package template;
/**
* Template Method Design Pattern — Runnable Demo
* Run: javac template/*.java -d out/template && java -cp out/template template.Main
* Article: https://ankurm.com/template-method-design-pattern-java/
*/
public class Main {
public static void main(String[] args) {
System.out.println("=== Template Method Design Pattern Demo ===");
DataMigration csvJob = new CsvMigration("customers_export.csv");
csvJob.migrate();
DataMigration apiJob = new ApiMigration("https://api.partner.com/v2/orders");
apiJob.migrate();
System.out.println("-- Both jobs used the same migrate() skeleton --");
System.out.println("-- Each provided its own connect/read/transform implementation --");
System.out.println("-- ApiMigration overrode the sendNotification() hook: no email --");
System.out.println("\n=== Demo complete ===");
}
}