Build a Notification Dispatcher

Factory pattern

Challenge 1 of Create & Share ObjectsBeginner~55 minFree

Callers should say send this on email and never touch a class name. The Factory pattern puts that decision in one place. Build concrete notifiers, a simple factory function, a registry-driven factory you can extend without editing, then a service that dispatches and fans messages out across many channels at once.

5 steps

  1. 1Concrete Notifiers
  2. 2The Factory Function
  3. 3A Registry-Based Factory
  4. 4The Notification Service
  5. 5Broadcast Fan-Out
Start step 1