Skip to content
Ameen Abozaid
Planned lessonMID-026-L03

Commands vs events

  • Lesson 3 of 6
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

name messages correctly.

Planned topics

  • A command asks for something to be done: ReserveStock. Imperative name, one intended receiver, can be rejected.
  • An event states a fact that happened: StockReserved. Past tense, any number of listeners, cannot be rejected.
  • The publisher of an event does not know or care who listens.
  • A "command in disguise" like OrderPlacedPleaseReserveStock couples sender to receiver.
  • Name events after business facts, not technical changes (OrderPlaced, not OrdersRowInserted).
Draft outline details

Demonstration

a table of five Shop messages classified as command or event.

Check your understanding

Is PaymentAuthorized a command or an event?

Show answer

An event; it is past tense.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.