O'Reilly logo
live online training icon Live Online training

Domain-Driven Design: First Steps

Building software and team structures that evolve and scale

Topic: Software Development
Andrew Harmel-Law

Domain-driven design (DDD) is hard. But it’s also one of the best ways to design software that works, and is enjoyable to work with. By helping you collaborate with expert users (“domain experts” in DDD), tapping into their existing mental models, and consequently building deep, insight into the problems you’re trying to solve, DDD helps you keep your software lean, focused, and fulfilling to work with. So where do you start?

Expert Andrew Harmel-Law guides you through your first steps on the journey to becoming a DDD master. You’ll learn by doing, as you explore key parts of DDD—and, more importantly, understand which parts you can safely ignore for now.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • The three fundamental aspects of DDD
  • How DDD helps you write great, maintainable software that’s fun to work with
  • How to apply DDD to your problems from the very beginning
  • What parts of DDD to ignore (for now)

And you’ll be able to:

  • Make your first steps toward using DDD as a tool that works for you
  • Use core DDD approaches and patterns to understand and break down complex problems
  • Write code that you feel confident in and that closely reflects your understanding, free from pollution by frameworks, etc.

This training course is for you because...

  • You’ve heard that DDD is a great tool and want to see for yourself.
  • You’ve tried DDD unsuccessfully but want to give it another shot.

Prerequisites

  • A working knowledge of an object-oriented programming language (Java, Kotlin, C#, Ruby, etc.)
  • A computer with the Java JDK (at least Java 8), the IDE of your choice, and a Git client installed

Recommended preparation:

  • Set up the Gradle project for the exercises. (Follow the instructions in the project README) - 5-10 minutes
  • Read the domain information which we’ll use for all our exercises (It’s a few pages long. If you feel like it, there’s no harm in having a go at coding it up in advance - just make sure you start the course with the freshly checked out repo) - 10 minutes (CONTENT WARNING: This document describes how the United Kingdom Criminal Justice system works. It does not talk about any specific cases, nor does it talk about specific criminal offences.)
  • Read the introduction to “Part I: The Money Example,” “Multi-Currency Money,” and “Degenerate Objects” (chapters 1–2 in Test Driven Development: By Example)
  • Read “Well-Designed Apps Rock: Great Software Begins Here” (chapter 1 in Head First Object-Oriented Analysis and Design)

Recommended follow-up:

About your instructor

  • A highly enthusiastic, self-starting and responsible Tech Principal for Thoughtworks, Andrew specialises in Java / JVM technologies, agile delivery, build tools and automation, and domain driven design.

    Experienced across the software development lifecycle and in many sectors including government, banking, and eCommerce; what motivates him is the efficient delivery of large-scale software solutions, fulfilling complex user needs. He understands that people, architecture, process and tooling all have key roles to play in achieving this.

    Andrew has a passion for open source software and its communities. He has been involved with OSS to a greater or lesser extent since his career began; as a user, contributor, expert group member, or paid advocate - most famously as one of the Jenkins Job-DSL originators.

    Andrew enjoys sharing his experience as much as possible. This sharing is not only seen in his formal consulting engagements, but also informally through mentoring, blog posts, conferences (speaking and organising), and open-sourcing his code.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Introduction – Why Are We Here? (10 minutes)

  • Presentation: What Domain-driven design is and how it can help
  • Discussion: Expectations for the session
  • Q&A

Collaborating with Domain Experts (15 minutes)

  • Presentation: Collaborating with Domain Experts
  • Q&A

First Steps Modelling Our Domain (25 minutes)

  • Exercise: First steps modelling our domain
  • Q&A
  • Break: 5 minutes

What can a model do? (25 minutes)

  • Discussion: What are models used for?
  • Presentation: What a model can do (with some relatable examples - tube maps, etc.)
  • Discussion: Did we model too much or too little in the first exercise?
  • Q&A

Actors, activities and fewer things (25 minutes)

  • Exercise: Add modules (packages) and move our classes into them
  • Q&A

Refactoring for Greater Clarity (10 minutes)

  • Add modules (packages) and move our classes into
  • Q&A
  • Break: 5 minutes

Our Model Breaks / We Have a Breakthrough (25 minutes)

  • Exercise: Include new detail in our model (from later on in the domain expert statement)
  • Presentation: What broke, what we discussed with the Domain Expert, the deeper insight we gained as a result
  • Discussion: How did you feel doing that? Are you still happy with your model?
  • Q&A

Splitting our model (20 minutes)

  • Exercise: Splitting our model
  • Discussion: How does having duplication between your models make you feel?
  • Q&A

Taking these skills out into the world and experimenting (Wrap Up) (10 minutes)

  • Presentation: Summary of key DDD topics we covered, techniques we used, and further reading (highlighting the aspects of Domain-driven design we’ve encountered - ubiquitous language, hands on modellers, multiple models and more)
  • Closing Discussion
  • Q&A