You Don't Hate Mocks; You Hate Side Effects

I don’t think it does. If you have custom actions and logging for those events, then you already two listeners for every event. The custom actions are merely listeners to an event. When you need to add more behavior to the system, you can either change the event source and risk getting that wrong or simply add another listener to an existing event, without changing existing event sources.

I genuinely don’t see it as extra cognitive load. There are domain events that other code listens to. Done. That didn’t seem like a problem.

Global mutable shared state makes things worse. It always has. :slight_smile:

One level of indirection with a reasonable abstraction buys us two key benefits:

  • I can check the event source without needing to know anything about how production code handles the events.
  • I can easily add new listeners to existing events in order to add behavior to the system.

That sounds great to me.