SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
DEVS, LET'S RECLAIM DDD!
Arnaud THIEFAINE
Dorra BARTAGUIZ
WHY SHOULD WE LEARN DDD?
It’s so stylish! I want to do like
those who talk
about it.
For an awesome
resume!
It might be useful at
the end!
@ArnaudThiefaine @DorraBartaguiz
DDD
BUZZ WORD?
@ArnaudThiefaine @DorraBartaguiz
WHO ARE WE?
Coach / trainer
Co-author « Software Craft »
ArnaudThiefaine
athiefaine
VP Tech @Arolla
Co-author & illustrator « Software Craft »
DorraBartaguiz
iAmDorra
Arnaud
THIEFAINE
Dorra
BARTAGUIZ
https://www.arolla.fr/training/
DOMAIN DRIVEN DESIGN
20 years
@ArnaudThiefaine @DorraBartaguiz
SURVEY
Do you know
DDD?
No
5%
Yes, I
know the
name
28%
Yes, I
apply
some
concepts
42%
Yes, I use
it daily
25%
@ArnaudThiefaine @DorraBartaguiz
Appreciate DDD
~56%
Find it difficult to apply
~63%
@ArnaudThiefaine @DorraBartaguiz
WHAT WE REPROACH THE DDD?
I am not an architect,
so I did not have the
opportunity to dig
I do not have access
to the organization's
strategic discussions
The organization
and the teams are
too hermetic to
make it
It is mainly used to
make bullshit
diagrams
It does not go back
to the code
@ArnaudThiefaine @DorraBartaguiz
SUMMARY
• Modelling Kata (Theater Kata)
• Value Object to rescue primitive-obsessions
• Business and technic separation
• Sandwich pattern
• Hexagonal architecture
• Bounded Contexts identification
• Protect invariants
• Aggregate
• Entity
• Value Object
• Service & repository
• Separate Bounded Contexts
@ArnaudThiefaine @DorraBartaguiz
50% VIP
35€ standard category
+50% for premium
THEATER KATA
Beatriz « The CICD »
@ArnaudThiefaine @DorraBartaguiz
THEATER KATA
Side-by-side seats
Loyalty card
Tickets
Premium category
Alix books 4 seats
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
PRICING ARITHMETICS
@ArnaudThiefaine @DorraBartaguiz
PRICING ARITHMETICS
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
PATTERN SANDWICH
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
IDENTIFICATION OF
DIFFERENTS
BUSINESS/DOMAINS
Aka Bounded Contexts
@ArnaudThiefaine @DorraBartaguiz
@ArnaudThiefaine @DorraBartaguiz
@ArnaudThiefaine @DorraBartaguiz
SJƆ & ING
Seat
reservation
Marketing
Performance
scheduling
Pricing
Ticketing
@ArnaudThiefaine @DorraBartaguiz
SJƆ & ING
Seat
reservation
Marketing
Performance
scheduling
Pricing
Ticketing
@ArnaudThiefaine @DorraBartaguiz
PERSONAE
Beatriz, actress
Julia,
marketing
Alix, client
Director
Terminal
@ArnaudThiefaine @DorraBartaguiz
SYNONYMS
Entry
reservation
Seat layout
Marketing
Performance
scheduling
Pricing
Ticket
printing
Premium
armchair
@ArnaudThiefaine @DorraBartaguiz
@ArnaudThiefaine @DorraBartaguiz
BC IDENTIFICATION HINTS
• “/t/s/ion” sjɔ̃
• “ing”
• Different personae
• Synonyms
• Words with multiple meanings
@ArnaudThiefaine @DorraBartaguiz
HEXAGONAL ARCHITECTURE
Not Domain
Domain
Adapters
Ports
API / exposition SPI / infra
Mock infra
not domain
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
SPECIFICATION
• Domain Invariant : predicat
• Validate a domain objet using isSatisfiedBy()
• Model a rule
• Configurable
Domain
Specification
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
REPOSITORY
• Collection-oriented
• Manage transaction
• in repo not the service
• Side Effect
• Injectable
• Ubiquitous language
• For naming
Domain
Repository
@ArnaudThiefaine @DorraBartaguiz
AGGREGATE
• Unique identity for the grape
• Aggregate Root
• Invariant to protect
• Consistence
• validity
• transactional (save/load)
Domain
Aggregate
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
Allocation
Performance
Id
play
startDate
endDate
performanceNature
Reservation
Topology
@ArnaudThiefaine @DorraBartaguiz
Allocation
TheaterSession
titre
startDate
Reservation
PerformanceNature
value
Performance
Id
play
startDate
endDate
performanceNature
Topology
@ArnaudThiefaine @DorraBartaguiz
Value object
No identity
Value equality
Immutable
Parametrized Constructor
Factory method
Side-effect-free
Entity
Unique identity
Evolves over time
Domain
Entity
ValueObject
@ArnaudThiefaine @DorraBartaguiz
Entity
Identity
Empty /
filled
Value
object
https://www.amazon.fr/Marque-verres-Party-UNO-VINO-couleurs/dp/B00NXLXFBE/ref=asc_df_B00NXLXFBE?tag=bingshoppin0f-
21&linkCode=df0&hvadid=80676722682045&hvnetw=o&hvqmt=e&hvbmt=be&hvdev=c&hvlocint=&hvlocphy=&hvtargid=pla-4584276297093740&psc=1
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
THEATER TOPOLOGY
Balcony 1
(premium)
Balcony 2
(premium)
Row E
Row F
Row G
Row I
Row J
Row K
Row A
Row B
Row C
Row D
Central zone
(standard)
@ArnaudThiefaine @DorraBartaguiz
THEATER TOPOLOGY
Balcony 1
(premium)
Balcony 2
(premium)
Row E
Row F
Row G
Row I
Row J
Row K
Row A
Row B
Row C
Row D
Central zone
(standard)
@ArnaudThiefaine @DorraBartaguiz
THEATER TOPOLOGY
Balcony 1
(premium)
Balcony 2
(premium)
Row E
Row F
Row G
Row I
Row J
Row K
Row A
Row B
Row C
Row D
Central zone
(standard)
@ArnaudThiefaine @DorraBartaguiz
SEAT ALLOCATION
Row E
Row F
Row G
Row I
Row J
Row K
Row A
Row B
Row C
Row D
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
SERVICE
• Stateless
• Injectable
• Business logic
• Neither in Value Object
• Nor in Entity
• Ubiquitous language
• For naming
Domain
Service
Service
@ArnaudThiefaine @DorraBartaguiz
Make sure you need a service. […]
Using Services overzealously will
usually result in the negative
consequences of creating an
Anemic Domain Model.
- Vaughn Vernon
Implementing Domain-Driven Design
@ArnaudThiefaine @DorraBartaguiz
TO SUM UP
Aggregate
Aggregate
root
Entity
Value
object
Service
Repository Components
(injectables)
Domain model
(instantiables)
Specification
@ArnaudThiefaine @DorraBartaguiz
LET’S CODE
@ArnaudThiefaine @DorraBartaguiz
Reservation
Ticketing
Seat
allocation
Allocation
pooling
Billing
Customer account
(subscription)
Pricing
Theater
topology
@ArnaudThiefaine @DorraBartaguiz
UP TO YOU!
• Rely on test coverage
• Identify Bounded Contexts
• Refactor in baby steps
• Extract Value Object, Entities,
• Aggregates, Repositories, Services
• Promote naming
@ArnaudThiefaine @DorraBartaguiz
THANKS @ARNAUDTHIEFAINE
@DORRABARTAGUIZ

Mais conteúdo relacionado

Último

Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Lovely Professional University
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
Kamal Acharya
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
drjose256
 

Último (20)

How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdf
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
BORESCOPE INSPECTION for engins CFM56.pdf
BORESCOPE INSPECTION for engins CFM56.pdfBORESCOPE INSPECTION for engins CFM56.pdf
BORESCOPE INSPECTION for engins CFM56.pdf
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Introduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoIntroduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of Arduino
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and Applications
 

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Devs, let's reclaim DDD!