Created
November 29, 2023 09:08
-
-
Save vladdedita/34c1fda2ff971639f77a9bb10f2f7f6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface NotificationService { | |
void sendNotification(String message, String recipient); | |
String getServiceName(); | |
} | |
@Component | |
public class EmailNotificationService implements NotificationService { | |
public void sendNotification(String message, String recipient) { /* Email sending logic */ } | |
public String getServiceName() { return "Email"; } | |
} | |
@Component | |
public class SMSNotificationService implements NotificationService { | |
public void sendNotification(String message, String recipient) { /* SMS sending logic */ } | |
public String getServiceName() { return "SMS"; } | |
} | |
@Component | |
public class PushNotificationService implements NotificationService { | |
public void sendNotification(String message, String recipient) { /* Push notification logic */ } | |
public String getServiceName() { return "Push"; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment