An introduction to DDD

A presentation at PHPUK 2024 in February 2024 in London, UK by Rob Allen

Slide 1

Slide 1

An introduction to Domain Driven Design Rob Allen, February 2024

Slide 2

Slide 2

It started with a book Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 3

Slide 3

Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 4

Slide 4

DDD provides for the Strategic and Tactical Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 5

Slide 5

Strategic Design Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 6

Slide 6

Domains & Models Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 7

Slide 7

Slide 8

Slide 8

A Domain is something in the real-world Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 9

Slide 9

A Domain is the subject of our project Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 10

Slide 10

A Domain is understood by experts in the space Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 11

Slide 11

A Domain Model is a representation of the Domain Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 12

Slide 12

A Domain Model is an abstraction of reality Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 13

Slide 13

A Domain Model is expressed as diagrams, words, code Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 14

Slide 14

Expressed as a diagram Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 15

Slide 15

Building domain knowledge Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 16

Slide 16

“We have really everything in common with America nowadays except, of course, language” Oscar Wilde Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 17

Slide 17

Ubiquitous Language Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 18

Slide 18

Ubiquitous Language is The agreed concepts, meanings and terms for the project Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 19

Slide 19

You have to talk! Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 20

Slide 20

Ubiquitous Language is Foundational to implementing Domain Driven Design Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 21

Slide 21

In Domain-Driven Design Everything revolves around Ubiquitous Language Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 22

Slide 22

Observations about creating a domain model Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 23

Slide 23

Focus effort where it matters Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 24

Slide 24

Knowledge Crunching Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 25

Slide 25

Knowledge Crunching Event Storming Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 26

Slide 26

By Henning Schwentner - CC BY-SA 4.0

Slide 27

Slide 27

Knowledge Crunching User Story Mapping Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 28

Slide 28

By Dai Fujihara - CC BY-SA 2.0

Slide 29

Slide 29

Knowledge Crunching Event Modelling Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 30

Slide 30

Model change over time Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 31

Slide 31

Managing Domain Complexity Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 32

Slide 32

Bounded Contexts define the boundary for a model Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 33

Slide 33

Bounded Contexts protect the domain model from dilution Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 34

Slide 34

Bounded Contexts are composed into an application Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 35

Slide 35

Context maps Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 36

Slide 36

Tactical Design Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 37

Slide 37

Tactical Design Entities, Value Objects & Aggregates Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 38

Slide 38

Entities & Value Objects Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 39

Slide 39

Tactical Design Storing State Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 40

Slide 40

Tactical Design Services Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 41

Slide 41

Services Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 42

Slide 42

Tactical Design Architecture Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 43

Slide 43

Architecture Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 44

Slide 44

Architecture Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 45

Slide 45

Architecture Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 46

Slide 46

Architecture Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 47

Slide 47

To sum up Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 48

Slide 48

To sum up Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 49

Slide 49

“Domain-Driven Design is about creating shared understanding of the problem space that is reinforced ubiquitously via conversations, code and diagrams.” Nick Tune Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 50

Slide 50

Thank you! Rob Allen | @akrabat | social.akrabat.com/@rob

Slide 51

Slide 51

Photo Credits - Risk: I. Hassan, https://www.flickr.com/photos/iahvector/15342391100 - Event Storming: H Schwentner, https://commons.wikimedia.org/w/index.php?curid=57766348 - Story Mapping: D Fujihara, https://www.flickr.com/photos/49942291@N06/6271934371 Rob Allen | @akrabat | social.akrabat.com/@rob