Your Ticket 🎫
AlertHub sends user notifications via Email, SMS, or Slack.
The current code creates notifiers with
new scattered across
the codebase — every caller must know which class to instantiate.
When a new channel is added, every call site must be updated.
Tests can't swap in fake notifiers because nothing is abstracted.
Your mission:
Introduce the
Factory Method or
Abstract Factory pattern:
1. Define an
INotifier interface with a
Send(string to, string message) method
2. Create concrete implementations:
EmailNotifier,
SmsNotifier,
SlackNotifier
3. Create a
NotifierFactory with a static
Create(string channel) method
that returns the correct
INotifier — callers never use
new
4.
AlertService must use the factory, never instantiate notifiers directly
You'll be scored on *structure*, not runtime behavior.