Slide 1

Slide 1 text

www.lilobase.me The strategies behind DDD @lilobase #MeetupDeconfinement lgo.group

Slide 2

Slide 2 text

Let’s start a new project !

Slide 3

Slide 3 text

Let’s start a new project ! We just receive the customer’s requirements, we still need to clarify a few things. But you can start the preliminary design phase ! Let's do a sprint zero !

Slide 4

Slide 4 text

SQL or NoSQL ? Java or C# ? Spring Boot or Quarkus ? PostgreSQL or MySQL ? Kafka or Redis ? Microservices or Monolith ? Kubernetes or Nomad ? Angular or React ?

Slide 5

Slide 5 text

What are you working on ? There are still some uncertainties, but we’re gonna use kafka …

Slide 6

Slide 6 text

Java or C# ? PostgreSQL or MySQL ? Kafka or Redis ? Microservices or Monolith ? Kubernetes or Nomad ? SQL or NoSQL ? Spring Boot or Quarkus ? These issues address only the solution

Slide 7

Slide 7 text

Java or C# ? PostgreSQL or MySQL ? Kafka or Redis ? Microservices or Monolith ? Kubernetes or Nomad ? SQL or NoSQL ? Spring Boot or Quarkus ? These issues address only the solution But not the problem What should we do ?

Slide 8

Slide 8 text

These issues address only the solution But not the problem What should we do ? How are we going to do it ?

Slide 9

Slide 9 text

These issues address only the solution And that's why we keep being treated as technical specialists

Slide 10

Slide 10 text

These issues address only the solution It is an important discussion to have But not the problem But only after we've figured out what to do

Slide 11

Slide 11 text

These issues address only the solution And are the hardest to refactor

Slide 12

Slide 12 text

Let’s rewind

Slide 13

Slide 13 text

Let’s start a new project !

Slide 14

Slide 14 text

Let’s start a new project ! We just receive the customer’s requirements, we still need to clarify a few things. But you can start the preliminary design phase ! Let's do a sprint zero !

Slide 15

Slide 15 text

I heard about « Domain Driven Design », maybe we should use it ! Yeah, that's a great idea.

Slide 16

Slide 16 text

Aggregate Repository Bounded Context as Microservices Domain Service Event Driven CQRS Entity Value Object Hexagonal Architecture

Slide 17

Slide 17 text

What are you working on ? There are still some uncertainties, but we’re gonna use an event-driven hexagonal architecture …

Slide 18

Slide 18 text

These issues still address only the solution Aggregate Repository Bounded Context as Microservices Domain Service CQRS Entity Value Object Hexagonal Architecture Event Driven

Slide 19

Slide 19 text

These issues still address only the solution This is what we call « DDD Lite »

Slide 20

Slide 20 text

These issues still address only the solution And that's why we keep being treated as technical specialists

Slide 21

Slide 21 text

www.lilobase.me DDD is all about Alignment @lilobase

Slide 22

Slide 22 text

DDD is all about Alignment What should we do ? How are we going to do it ?

Slide 23

Slide 23 text

DDD is all about Alignment What should we do ? How are we going to do it ?

Slide 24

Slide 24 text

Domains & Subdomains Business Domain discovery THE Software Authoring & Publishing Printing & Supply Chain Customer Care Retail Store You need to acknowledge the fact that you have several domains

Slide 25

Slide 25 text

Retail Store Inventory Customer Care Shipping Only one VP should be angry at a time Retail Store Inventory Customer Care Shipping Authoring & Publishing Printing & Supply Chain Customer Care Retail Store Domains & Subdomains Business Domain discovery

Slide 26

Slide 26 text

Retail Store Inventory Customer Care Shipping These are neither Bounded Contexts nor Microservices Authoring & Publishing Printing & Supply Chain Customer Care Retail Store Domains & Subdomains Business Domain discovery

Slide 27

Slide 27 text

Retail Store Inventory Customer Care Shipping These are your domains Authoring & Publishing Printing & Supply Chain Customer Care Retail Store Domains & Subdomains Business Domain discovery

Slide 28

Slide 28 text

Your domains contain domains Domains & Subdomains Business Domain discovery Online Retail Store Payment processor Catalogue Invoicing

Slide 29

Slide 29 text

Domain Mapping Business Domain Classification Authoring Plateform Publishing & Printing Inventory Management Payment Processor Catalogue Invoicing Shipping Order Processing Proofreading

Slide 30

Slide 30 text

Supporting Subdomain Generic Subdomain Core (sub)Domain Key differentiator Domains & Subdomains Business Domain Classification Essential to the organization’s success Required for the organization’s success Critical to the organization’s success

Slide 31

Slide 31 text

Domains & Subdomains Business Domain Classification Authoring Plateform Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing Publishing & Printing Proofreading

Slide 32

Slide 32 text

Domains & Subdomains Business Domain Classification Authoring Plateform Inventory Management Payment Processor Catalogue Invoicing Each business context is specific Shipping Order Processing Publishing & Printing Proofreading

Slide 33

Slide 33 text

Authoring Plateform Domains’ Connexion Reveal Business Relationships Inventory Management Shipping Catalogue Invoicing Order Processing Payment Processor It can highlight significant sub-domain Publishing & Printing Proofreading

Slide 34

Slide 34 text

www.lilobase.me DDD is all about Context @lilobase

Slide 35

Slide 35 text

From Problem to Solution Business Domain & Architecture alignment Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing problem Proofreading

Slide 36

Slide 36 text

From Problem to Solution Business Domain & Architecture alignment Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing problem solution Payment processor Invoicing Order Processing Shipping Authoring Plateforme Inventory Management Catalogue Publishing Proofreading Proofreading Inventory E-commerce platform Authoring Publishing

Slide 37

Slide 37 text

Domains & Subdomains Development Strategy Supporting Subdomain In-House development with external support if possible Generic Subdomain Outsourcing is an option Core (sub)Domain In-House development with Your best teams Key differentiator

Slide 38

Slide 38 text

Domains & Subdomains Development Strategy Supporting Subdomain Customized Off The Shelf Software is an option Generic Subdomain Try to find Off The Shelf solution Cost saving opportunities Core (sub)Domain Custom-made software High Cost & Quality Key differentiator

Slide 39

Slide 39 text

From Problem to Solution Business Domain & Architecture alignment Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing problem solution Payment processor Invoicing Order Processing Shipping Authoring Plateforme Inventory Management Catalogue Publishing Proofreading Proofreading Inventory E-commerce platform Authoring Publishing

Slide 40

Slide 40 text

From Problem to Solution Business Domain & Architecture alignment Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing problem solution Proofreading Inventory E-commerce platform Authoring Authoring Plateforme Publishing Catalogue Publishing Proofreading

Slide 41

Slide 41 text

From Problem to Solution Business Domain & Architecture alignment Inventory E-commerce platform Authoring Authoring Plateforme Publishing Catalogue Publishing Proofreading These are your bounded contexts

Slide 42

Slide 42 text

P Authoring Publishing E-commerce Stripe ShipMonk Shopify Context Mapping Relationship Hierarchy These are your bounded contexts OHS OHS ACL OHS C/S

Slide 43

Slide 43 text

Authoring Publishing E-commerce Specific Architecture style You don’t need one architectural style Beware of the CRUD ES CQRS CRUD ? Stripe ShipMonk Shopify

Slide 44

Slide 44 text

Stripe Still no microservices Bounded Context ≠ Deployment units ShipMonk Authoring Publishing E-commerce Shopify Deployment Unit

Slide 45

Slide 45 text

Deployment Unit Stripe Still no microservices Bounded Context ≠ Deployment units ShipMonk Authoring Publishing E-commerce Shopify Deployment Unit

Slide 46

Slide 46 text

Domains are not immutable Understanding is a never-ending process Stripe ShipMonk Authoring Publishing E-commerce Shopify Printing

Slide 47

Slide 47 text

www.lilobase.me DDD is all about Boundaries @lilobase

Slide 48

Slide 48 text

Semantic Boundaries Between BC meaning are different Authoring Publishing Book Chapter Chapter They are not the same book What happens if the author revises his book?

Slide 49

Slide 49 text

Semantic Boundaries Between BC meaning are different Chapter This is why you must start by understand strategically your domain Author Book Reviews Release Catalogue

Slide 50

Slide 50 text

Semantic Boundaries Between BC meaning are different Authoring Publishing Book Chapter Chapter Book Chapter Chapter Inside a Bounded Context, Don’t Repeat Yourself Between Bounded Context, Write Everything Twice

Slide 51

Slide 51 text

Don’t cross them Between BC meaning are different Authoring Publishing Author Reviews Author Book Book Release Never create relationships between entities from two BC

Slide 52

Slide 52 text

Don’t cross them Between BC meaning are different Authoring Publishing Book Book Release Author Author Reviews This is exactly the same

Slide 53

Slide 53 text

Don’t cross them Between BC meaning are different Authoring Publishing Book Book Release Author Author Reviews API API

Slide 54

Slide 54 text

Same for Events Between BC meaning are different Authoring Publishing This is exactly the same Event Bus Book Book Release Author Author Reviews

Slide 55

Slide 55 text

Same for Events Between BC meaning are different Authoring Publishing Event Bus Book Book Release Author Author Reviews Translator Translator

Slide 56

Slide 56 text

Transactional Boundaries Protect your integrity Authoring Book Chapter Chapter Chapter Statistics Inside your bounded Context live Entities They are grouped in Aggregates

Slide 57

Slide 57 text

Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics They are retrieved and persisted as a whole Inside an aggregate, Entities share the same lifecycle

Slide 58

Slide 58 text

Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics Who ensures the aggregate integrity All interactions are done through the Aggregate Root Write a new chapter

Slide 59

Slide 59 text

Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics Write a new chapter Chapter Inconsistency

Slide 60

Slide 60 text

Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics But don’t put to much in it Author What happens if we delete the book ? They must share the same lifecycle

Slide 61

Slide 61 text

Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics Author reference Author Id

Slide 62

Slide 62 text

Designing Boundaries Protect your domain Printing Team We need printing margin Book Chapter Chapter Chapter Release We need the colorimetric profile Printing margin Colorimetric profile API Publishing Team

Slide 63

Slide 63 text

Designing Boundaries Protect your domain API We need printing margin Book Chapter Chapter Chapter Release We need the colorimetric profile Printing margin Colorimetric profile Domain Leakage Publishing Team Printing Team

Slide 64

Slide 64 text

Designing Boundaries Protect your domain Publishing Team Printing Team Publishing API We need printing margin Book We need the colorimetric profile Printing margin Colorimetric profile Printing API We discovered the need for an ACL

Slide 65

Slide 65 text

www.lilobase.me DDD is all about Compassion @lilobase

Slide 66

Slide 66 text

A A A Ubiquitous language Stakeholders & Team Alignement Dev Domain Expert Dev

Slide 67

Slide 67 text

A A A not « just » a glossary Ubiquitous language Stakeholders & Team Alignement Dev Domain Expert Dev

Slide 68

Slide 68 text

Ubiquitous language Each BC has its own Authoring Publishing A A

Slide 69

Slide 69 text

Ubiquitous language Each BC has its own Authoring Publishing A A A A It is a common cause of miscommunication

Slide 70

Slide 70 text

Pair Programing The best way to share a domain understanding Dev Domain Expert

Slide 71

Slide 71 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User

Slide 72

Slide 72 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User He has the last word regarding domain implementation

Slide 73

Slide 73 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User Prioritize development & formalize users’ feedback

Slide 74

Slide 74 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User Power of Life and Death over the project

Slide 75

Slide 75 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User Too often forgotten

Slide 76

Slide 76 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User Maybe you could spend a day per month working with them ?

Slide 77

Slide 77 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User They design the software specification

Slide 78

Slide 78 text

Know your users They might not be who you think they are Dev Domain Expert Product Owner Customer User What he understood goes into production

Slide 79

Slide 79 text

“A loosely coupled software architecture and org structure to match” is a key predictor of: • Continuous Delivery Performance • Ability to scale organization and increase performance linearly This is what DDD is All About ! — Michael Plöd (@bitboss)

Slide 80

Slide 80 text

www.lilobase.me Thanks @lilobase https://roti.express/r/ddd-hyf lgo.group