Decorator: sending notifications

Add behaviour to an object by wrapping it in another object with the same interface.

Level Intermediate

What you will see

  1. One email, three extra jobs
  2. One class, one option per job
  3. A notifier that holds a notifier
  4. Before, after or around the call
  5. The order of the layers
  6. When not to use it

Before / after

Base: decorator-base-tsView the diff

Exercises