Domain-Driven Design, CQRS and Event Sourcing Unlocked
An interview with Marco Heimeshoff
We chatted with our trainer Marco Heimeshoff, self-proclaimed DDD care-bear and all-round expert when it comes to the challenging relationship between people and technology. Enthusiastic and full of energy, Marco gives us a fresh insight on the world of software development, Domain-Driven Design, and everything in between.
Avanscoperta: Hello Marco, Wie geht’s? :-)
Marco: Guten Tag, as always I am surfing the wave between being overwhelmed by all the great things I want to learn and do and being bored by having too much free time. :)
Avanscoperta: The classic of all the classics: How did you get into programming and why?
Marco: I got into programming multiple times actually.
The first time was in the early 90s, I was into gaming and learning all the secrets of what you can do with a computer (which was basically just another toy for me). Building my own text adventure with Pascal in MS-DOS kept me awake for many nights.
The second time was after finishing school. I started solving other people's problems by coding anything from websites with forums to business solutions for time tracking etc.
Programming was great, logical and something I could master at my own pace and without having to talk to fuzzy, emotional humans ;)
The third time was around 2009/2010, when I realised that the fuzzy needs of humans and the imprecise language and interdependent needs of different individuals are actually who we are solving problems for.
Programming wasn’t about coding a perfect and pristine system anymore, but about communication and model building and iterating through complex scenarios to actually help people solving real problems as good as possible.
Avanscoperta: Germany, your native country, must have been very different back when you started off.
How did the changes in the history of your country, and of the world, affect the availability of technology and technological devices?
Marco: That is a bit of a painful topic. Since Germany is economically pretty stable and strong, we’ve always had access to technologies and devices pretty much immediately.
Yet, the German industry culture is more one of caution and less of experimentation, so we ourselves did not excel in new tech as a nation.
Our internet is famously slow and outside of bigger towns basically non-existent. It’s a lot of fun as a traveling consultant. ;)
But things are changing, slowly but measurably, and I’d like to think that we in the Agile and DDD community play an important role in this change.
Avanscoperta: How would you explain the concepts of DDD, CQRS and Event Sourcing to a non-technical person?
Marco: Domain-Driven Design is a way of thinking about the needs of our customers first and letting the design of our solutions be driven by the nature and structure of their domain.
It is not a fixed set of tools, but a growing body of ideas and methods to explore complex problems together and design and evaluate multiple solutions with different trade-offs to choose from.
DDD encourages alignment on all levels of a business and has the potential to change every step in the production process, from code to culture, from agile to architecture.
CQRS is an architecture pattern that works very well with domain-driven design. Instead of building one single model to accommodate different needs at once, it is all about building different models to solve each problem as optimal as possible and still make the system as a whole work as one.
With Event Sourcing as a semantic and message-driven persistence technology, we can express everything that happens in your business in clear, human-readable language, and use this language as the source of truth for our systems state.
Avanscoperta: The next question is: why a non-technical person should care about them?
Marco: With a focus on the semantics of the domain and a high alignment between mental and technical models, the developers become proficient and invested in the domain they are building software for.
The risk of misinterpretation and building misaligned solutions goes down, while the potential to uncover and build higher business value go way up!
Avanscoperta: When was the first time you met Alberto Brandolini (inventor of EventStorming and one of the world's leading experts on DDD)?
Marco: In 2013 at the IDDD Tour in Belgium, I was talking about CQRS and Event Sourcing and afterward Alberto introduced us to Model Storming.
Working with Sticky Notes to represent Commands and Events during modeling totally blew my mind and was the missing link for me between domain modeling and implementing in a semantic way.
The same year in November I assisted Alberto in his EventStorming workshop in Vilnius. Ever since he has been an amazing source of crazy ideas. <3
Avanscoperta: How much do you use EventStorming in your work as a consultant and trainer, and where do you see it being most beneficial?
Marco: EventStorming is the swiss army knife of modeling if you ask me. I use it in trainings to get everyone energized and interested in the domain for the training, and to give an initial outlook on how to extract semantic messages and contextual boundaries for the implementation from a non-techie modeling session.
In consulting companies, EventStorming is my favourite tool to get everybody out of their comfort zone enough so we can start exploring the actual problem space, get transparency about the company culture and the socio-technical relationships and also get a deep understanding of the domain quickly.
I use various flavours of EventStorming for Big Picture exploration, implementable design, process modeling, understanding pain points and many more. It works well with User Story/Journey mapping, Bounded Context Canvas mapping and so forth and it provides a simple way to come up with great BDD Scenarios.
The major benefit in EventStorming these days lies in the engagement for the task at hand and the emerging collaboration between all stakeholders, since it provides a psychological safe space with a good facilitator and the right heuristics. (Did you know that Marco is a true EventStorming evangelist? e.d.)
Avanscoperta: What was the moment that made you realise how important the business perspective is from a software development point of view?
Marco: That came in 2009, whilst I was exploring how wonderfully ORMs abstract your database away.
A friend of mine told me that he didn’t need databases anymore and showed me CQRS and Event Sourcing. With semantic events in German language (the language of the domain), all of a sudden my brain had a hickup.
I realised that I am spending a huge amount of energy solving the wrong problem in very cool ways, yet the business problem was so darn hidden between all the elegant technical solutions.
CQRS and Event Sourcing solved all my problems (at the time) and allowed the code to align with the domain in a way that was just not possible before, it literally left me speechless that night.
In that session, I realised that the domain is the thing we actually need to master, and now we are starting to develop the tools to be able to implement it without suffocating in accidental complexity.
Avanscoperta: Marco, you're the author of a workshop titled “Domain Models in Practice: DDD, CQRS and Event Sourcing”. Would you tell us what makes this workshop different from all other workshops on DDD available out there?
Marco: This workshop takes you on a journey from modeling and learning about an unfamiliar domain, structuring a potential organisational and code structure and implement it iteratively in an agile way to provide the greatest business value first and keep on evaluating and implementing.
We will go back to first principles and learn that implementing everything ourselves is fairly straightforward, once you put the focus on the domain and separating it from the infrastructure.
We focus meticulously on semantic design, influenced by system thinking, psychology and the ever-evolving studies on human learning.
Avanscoperta: Who would benefit the most from this 3-day workshop?
Marco: Architects, Junior and Senior developers with an interest in Domain-driven design and/or in modern, message-driven architectures.
Those who know that understanding and implementing the domain is the most important part of their job and they want to learn hands-on how to do that.
Avanscoperta: I’m just about to buy a ticket for this one… convince me with a final pitch!
Marco: This workshop not only gives you a great tool to use elsewhere, it makes you a great toolmaker yourself. You will learn to adapt the patterns of CQRS and Event Sourcing and the philosophy behind DDD to face and grow in any challenge that might come your way.
Avanscoperta: Not only a trainer and a consultant, Marco is also one of the minds behind Berlin-based conference KDDDconf (formerly known as KanDDDinsky). Why did you decide to start organising KDDDconf? What’s the main drive behind that conference? One might say that there’s a lot of DDD-related conferences. What makes it special?
Marco: KDDDconf is not about DDD, it is about the art of business software. We want to enable developers of all levels of experience to provide better business value and to keep on growing in that ability.
Our speakers provide talks and hands-on sessions on any ideas and methods that help you become a better business software developer. Nowadays, DDD is at the center of that movement, and whatever topic fits, it gets integrated into the conference.
Avanscoperta: What’s the biggest challenge you face as an event organiser?
Marco: We are keeping the conference small (below 300 attendees), to keep the familiarity between speakers and attendees high. Speakers are just attendees who also give a talk in between, that part is great, but we have to decline a lot of great talks every year, otherwise we’d have to scale and become a more anonymous event, which we don’t want to… so… tradeoffs. ;)
Avanscoperta: What’s keeping you busy these days?
Marco: The list of experiments I am running is quite long, but the two most recent and more prominent fields are functional programming and game development.
I’ve been working on a piece of health care software in a German company for 12 years now, and in the last few years, we started writing our domain in F#, adapting functional domain modeling, which is very satisfying. I’ve started implementing the UI with functional programming as well, experimenting with Fable and F#. So yeah, functional all the things and DDD all the thingser.
Oh, and my side project is a small metroidvania game based on the german-children-books “Lucifer Junior”, that I code when I don’t want to business anymore :)
Avanscoperta: Another classic we like to close with is: Choose a soundtrack for your training.
Marco: As a salsa dancer and metalhead, there is only one choice: Bohemian Rhapsody by Queen. It is like my workshop, a weird, surprising, energizing mix of great ingredients that sticks in your heart and you won’t be able to remember how life was before.
Avanscoperta: That’s great Marco, many thanks for your answers and see you in Milan in March! ;-)
Pic credits: Marco Heimeshoff, Photo by Ashim D’Silva on Unsplash, Photo by Chris Barbalis on Unsplash.
Learn with Marco Heimeshoff
Marco is the trainer of the Domain Modeling in Practice: DDD, CQRS and Event Sourcing Workshop.
Check out the full list of our upcoming training courses: Avanscoperta Workshops.