Shows how to use Domain-Driven Design, Event Storming, Event Modeling and Event Sourcing in Heroes of Might & Magic III domain.
👉 See also implementations in:
👉 Let's explore the Heroes of Domain-Driven Design blogpost series
- There you will get familiar with the whole Software Development process: from knowledge crunching with domain experts, designing solution using Event Modeling, to implementation using DDD Building Blocks.
This project probably won't be a fully functional HOMM3 engine implementation because it's done for educational purposes. If you'd like to talk with me about mentioned development practices, feel free to contact on linkedin.com/in/mateusznakodach/.
I'm focused on domain modeling on the backend, but I'm going to implement UI like below in the future.
- Install Java (at least version 21) on your machine
./mvnw install -DskipTests
docker compose up
- Create Axon Server Context (details below)
./mvnw spring-boot:run
or./mvnw test
- Open the Axon Server UI at http://localhost:8024
- Go to: Event Store → Contexts
- Click "Create Context"
- Fill out details:
- Name:
heroesofddd
- Replication group: Create new
- Replication group name:
heroesofddd
- Nodes:
axon-server
- Role for axon-server: `PRIMARY'
- DCB context (beta): checked!!! — this is essential for the DCB support
- Name:
If you did not create the DCB context, the command execution will fail with the following error:
org.axonframework.commandhandling.CommandExecutionException: Exception while handling command
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE
Thanks to that, you will be able to browse stored events in the Axon Server UI and see the attached tags to each of them.
Modules (mostly designed using Bounded Context heuristic) are designed and documented on EventModeling below. Each slice in a module is in certain color which shows the progress:
- green -> completed
- yellow -> implementation in progress
- red -> to do
- grey -> design in progress
List of modules you can see in package com.dddheroes.heroesofddd
.
heroesofddd/
├── armies
├── astrologers
├── calendar
├── creature_recruitment
Each domain-focused module follows Vertical-Slice Architecture of three possible types: write, read and automation following Event Modeling nomenclature.
Slices:
- Write: BuildDwelling -> DwellingBuilt | test
- Write: IncreaseAvailableCreatures -> AvailableCreaturesChanged | test
- Write: RecruitCreature -> CreatureRecruited | test
- Read - TO BE IMPLEMENTED
- Automation - TO BE IMPLEMENTED