Raising events in commandhandlers

added by JefClaes
2/5/2013 3:18:32 AM

0 Kicks, 52 Views

Imagine I would want to do some extra stuff after creating the subscription; update the sales statistics, append the email address to a mailing list, send out a confirmation email, etc.. You could go at this by simply extending the commandhandler, but the problem here is that you quickly end up with a bulky and dependency-heavy commandhandler, which will quickly fail to communicate its intent. One solution could be to introduce events to decouple things in smaller pieces, and to help communicate intent more clearly.


0 comments