Add all 23 GoF design pattern implementations

This commit is contained in:
2026-07-25 10:50:29 +05:30
commit f5688a6b32
164 changed files with 4371 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 ===");
}
}