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,31 @@
package template;
public class ApiMigration extends DataMigration {
private final String endpoint;
public ApiMigration(String endpoint) { this.endpoint = endpoint; }
@Override protected String getSourceName() { return "API:" + endpoint; }
@Override
protected void connect() {
System.out.println(" Authenticating with API at " + endpoint + "...");
}
@Override
protected int readData() {
System.out.println(" Paginating through API responses...");
return 320;
}
@Override
protected int transformData(int rawCount) {
System.out.println(" Flattening JSON, deduplicating (" + rawCount + " records)...");
return rawCount - 15; // 15 duplicates removed
}
// Override hook: silent migrations from APIs, no email spam
@Override
protected boolean sendNotification() { return false; }
}