Axoniq Conference 2025 Day 2 | Event Modeling for Legacy Systems: Breaking the Greenfield Myth

Martin Dilger destroys the biggest myth in event modeling: "It only works for greenfield projects." Watch as he uses AI to extract event models from the Spring Pet Clinic (the mother of all CRUD apps), demonstrates four common anti-patterns discovered at the conference, and generates working code using the new Axon Platform - all without a single slide!

🎯 Speaker:

  • Martin Dilger - Consultant & Author of "Understanding Event Sourcing" (700 pages, 3,000+ readers)

  • Based in Germany, specializing in event sourcing and event modeling adoption

💡 The Revolution:

First Truth Bomb: Event modeling isn't just for greenfield - it's a documentation and understanding tool for ANY legacy system

The Process:

  • AI analyzes codebase → Generates event model → Understanding without code reading

  • Event model → Code generation → Running application

  • Works with CRUD, works with legacy, works with everything

📚 Book Background:

  • Title: "Understanding Event Sourcing" (700 pages)

  • Written in 3 months (1,000 words/day goal)

  • 3,000+ readers

  • Forwards by Adam (event modeling inventor) and Gabriel

💻 Live Demo Highlights:

Pet Registration Slice:
  • Drew ugly UI in under 2 minutes (name, description, age fields + save button)

  • Added "Register Pet" command

  • Added "Pet Registered" event

  • Defined information flow (name, description, age)

  • Information completeness check (red arrow → green arrow)

  • Exported JSON from Miro

  • Fed to Axon Platform

  • Generated working code

The 2,000 Character Hack:
  • Platform limitation: 2,000 characters max

  • Martin's solution: "Don't start generating before I tell you to start"

  • Used Claude to trim JSON under limit

  • Successfully bypassed restriction

  • Generated complete flows, commands, events

🎬 Key Moments:

  • "Drawing Ugly Screens is Part of the Process"

  • Rule: Never more than 2 minutes per UI

  • Philosophy: Speed over perfection in modeling phase

  • Reality: Most people waste 10-15 minutes per screen

"Information Completeness Check"
  • Red arrow = Missing information

  • Green arrow = Complete information flow

  • Prevents worst mistake: Wrong assumptions

  • Real-time validation during modeling

"Slices Are My Unit of Work"
  • Think in slices, work in slices

  • Each slice = independently deployable functionality

  • Start with one slice, implement it, ship it

  • No need to complete entire model before coding

🎓 Key Lessons:

1. Biggest Problems Aren't Technical
  • Technology is the easy 20%

  • Real challenge: Making everyone agree on the problem

  • Event modeling facilitates alignment

2. Nobody Has Greenfield Projects
  • Everyone deals with legacy systems

  • Event modeling works beautifully with existing code

  • Use it to understand, then decide: extract or document

3. Event Modeling → Any Stack
  • Could be event sourcing

  • Could be SQL inserts

  • Could be anything

  • It's about understanding, not implementation

4. AI as Event Modeling Accelerator
  • Extract models from code automatically

  • Generate models from requirements

  • Starting point for team discussions

  • Human discussion remains the critical part