An introduction to DDD

A presentation at PHPSW, January 2024 in January 2024 in Bristol, UK by Rob Allen

Slide 1

Slide 1

An introduction to Domain Driven Design Rob Allen, January 2024

Slide 2

Slide 2

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

Slide 3

Slide 3

Rob Allen | @rob@social.akrabat.com

Slide 4

Slide 4

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

Slide 5

Slide 5

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

Slide 6

Slide 6

Slide 7

Slide 7

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

Slide 8

Slide 8

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

Slide 9

Slide 9

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

Slide 10

Slide 10

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

Slide 11

Slide 11

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

Slide 12

Slide 12

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

Slide 13

Slide 13

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

Slide 14

Slide 14

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

Slide 15

Slide 15

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

Slide 16

Slide 16

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

Slide 17

Slide 17

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

Slide 18

Slide 18

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

Slide 19

Slide 19

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

Slide 20

Slide 20

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

Slide 21

Slide 21

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

Slide 22

Slide 22

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

Slide 23

Slide 23

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

Slide 24

Slide 24

By Henning Schwentner - CC BY-SA 4.0

Slide 25

Slide 25

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

Slide 26

Slide 26

By Dai Fujihara - CC BY-SA 2.0

Slide 27

Slide 27

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

Slide 28

Slide 28

eventmodelling.org

Slide 29

Slide 29

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

Slide 30

Slide 30

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

Slide 31

Slide 31

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

Slide 32

Slide 32

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

Slide 33

Slide 33

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

Slide 34

Slide 34

Tactical design Rob Allen | @rob@social.akrabat.com

Slide 35

Slide 35

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

Slide 36

Slide 36

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

Slide 37

Slide 37

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

Slide 38

Slide 38

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

Slide 39

Slide 39

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

Slide 40

Slide 40

“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 | @rob@social.akrabat.com

Slide 41

Slide 41

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

Slide 42

Slide 42

Photo Credits - 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 | @rob@social.akrabat.com