João Simões
1 min readJan 29, 2020

--

Indeed this is a recommended pattern, specially for more complex APIs, without too much boilerplate code. I would change some stuff ofc, but this is an example for thoughts, no need to enter into details.

I would just note that, while the mediator pattern in indeed helpful, it makes testing the controllers (or whoever uses the mediator) more complex because you don’t know exactly what a given method needs to work, and ties a lot of the tests into implementation details, instead of just expected behaviour (like knowing what handlers to mock).

But since the controllers are thin, we can assume if handlers are properly tested, outside of some mapping, very few things should probably fail.

Yet, it was a good article, straight to the point, keep it up.

--

--

João Simões
João Simões

Written by João Simões

Solutions Architect trying to solve world “problems”! Creator of https://code-corner.dev

No responses yet