Skip to content

Instantly share code, notes, and snippets.

@andremw
Last active June 30, 2020 00:19
Show Gist options
  • Save andremw/c12c37e68e28b21a427804b0c84d9c24 to your computer and use it in GitHub Desktop.
Save andremw/c12c37e68e28b21a427804b0c84d9c24 to your computer and use it in GitHub Desktop.
DutchBlitz with F# and DDD - improved workflow
Bounded Context: Dutch Blitz game
Workflow: "Join Game"
Triggered by:
"Join Game" command
Primary input:
A join request
Output events:
"Player joined game" event
Side-effects:
An acknowledgment is sent to the person
// step 1
do CheckGameAvailability
If game does not exist then:
Do not allow person to continue
stop
If game has started then:
Do not allow person to join
stop
If game is full then:
Do not allow person to join
stop
// step 2
do AddPersonToGame
// step 3
do SendAknowledgementToPerson
// step 4
return PlayerJoinedGame event (if no errors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment