Add creational patterns, Interpreter; remove scripts; update README
This commit is contained in:
11
01-creational/factory-method/NotificationService.java
Normal file
11
01-creational/factory-method/NotificationService.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package factorymethod;
|
||||
|
||||
/** Creator - declares the factory method */
|
||||
public abstract class NotificationService {
|
||||
protected abstract Notification createNotification();
|
||||
|
||||
public void notifyUser(String message) {
|
||||
Notification n = createNotification();
|
||||
n.send(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user