Files
Design-Patterns/patterns/bridge/Bridge Example/ReminderNotification.cs
2026-08-13 22:47:17 -04:00

14 lines
595 B
C#

namespace Bridge_Example;
//This is one of the refined abstraction classes. Note that it can make use of _sender since it inherits it from its superclass. Note also that since EmailSender and SmsSender implement IMessageSender, their specific SendMessage() method will be called, depending on what's passed into the constructor (see the main method)
public class ReminderNotification : Notification
{
public ReminderNotification(IMessageSender sender)
: base(sender) { }
public override void Notify(string message)
{
_sender.SendMessage($"Reminder: {message}");
}
}