Add all 23 GoF design pattern implementations
This commit is contained in:
13
01-creational/factory-method/EmailNotification.java
Normal file
13
01-creational/factory-method/EmailNotification.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package factorymethod;
|
||||
|
||||
public class EmailNotification implements Notification {
|
||||
|
||||
@Override
|
||||
public void send(String recipient, String message) {
|
||||
// In production: use JavaMail or Spring Mail
|
||||
System.out.printf(" [EMAIL] To: %s | Body: %s%n", recipient, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() { return "EMAIL"; }
|
||||
}
|
||||
Reference in New Issue
Block a user