SURFnet / sp-dashboard

SURFconext Service Provider Dashboard
Apache License 2.0
5 stars 2 forks source link

Make CommandHandlers less specific #1284

Open phavekes opened 3 weeks ago

phavekes commented 3 weeks ago

This issue is imported from pivotal - Originaly created at Nov 28, 2018 by Michiel Kodde

The command handlers often perform very specific tasks on the domain. Sometimes command handlers invoke new commands on the command bus. This is considered bad practice and might prove problematic in the future.

Proposal: Fix the command handlers an move much of their logic to services. In the case where CommandHandlers invoked commands on the bus. Review the shared logic between the handlers that need to perform the same task on the domain. It should be possible to move that logic to a service and let the handlers call that instead.