mardi 22 janvier 2019

Command-Event pattern Why command can have only one listener?

With regard to the command-event pattern I often find that commands or events are distinguished by the fact that a command can have only one listener while an event can have more listeners.

I’m wondering why and if that is really true.

If I need to notify something to someone in many different ways: by email, by fax, by push notification, what wrong publishing the command “SendNotification” and let three different subscribers (one that know how to notify users by mail, the second that know how to notify users fax, the third that know how notify users by google message cloud) receive the command and leaving them the burden of handling the notification?

Aucun commentaire:

Enregistrer un commentaire