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,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; }
}