Difference between Commands and Events?

42 views
Skip to first unread message

Glasn Host

unread,
Mar 29, 2021, 8:18:32 AM3/29/21
to EventStorming
Hi, 
I have trouble understanding the difference between a Command and an Event.
On my wall every Event has an exactly equal Command, like:
Command: Book an Hotel Room
Event: Room Booked....

The Command looks always very redundant and doesn't seem to add any value or knowledge to the picture...
I wonder if I got some concept wrong, or maybe there are just some situations where Command is more meaningful. But I can't get when.

thanks

mbo...@mbohlen.de

unread,
Mar 29, 2021, 9:02:02 AM3/29/21
to EventStorming
The command causes a certain part of your system to do something that has not been done, yet. It points into the future.
The event reports about something that has already happened. It points into the past.

When you write software, the command is a value object contained in the request that the client sends to the server, including the data that the server needs to execute the command, e.g. in the case of "Book a hotel room", the command contains the arrival date and the type of the room. Without the command, the system wouldn't know that you really want to book the room.

The event would be the message that goes out to other parts of the system, e.g. to a notification policy that sends you an email confirmation for your booking. Without the event, the notification policy wouldn't know that a booking has happened and that it needs to inform you.

Does that make sense? The command adds value because it clearly expresses the attributes needed to execute it (e.g. date and room type), the event adds value because it contains info about what exactly happened (room was successfully booked, or booking request was queued, or booking was denied because no room was available).

Cheers,
Matthias

Glasn Host

unread,
Mar 29, 2021, 1:06:51 PM3/29/21
to EventStorming

yes, thank you, definitively also from the point of view of writing software and of input/output makes more sense to me.

I also have to say that I've just started drawing a diagram and it was too simple, so all those postit "do that"-"done that" looked a bit silly.
When I started to add more things - like you mention, notification, external systems etc - it looks more meaningful to me...

Alberto Brandolini

unread,
Mar 29, 2021, 1:42:02 PM3/29/21
to Glasn Host, EventStorming
Keep in mind that developers are easily bored. But not every single step in a process is exciting.

Most of the Command-Event pairing is trivial, ...except when it's not. --> This is where you should look for missing abstractions.

Alberto

--
You received this message because you are subscribed to the Google Groups "EventStorming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eventstormin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eventstorming/bf341168-2ed2-48a8-93ef-9cd19e5e4388n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages