Naming in DDD
“express your intentions in your code”
@SepNamdar @KhaledSouf
Slide 2
Slide 2 text
Who we are?
SEPEHR NAMDAR
@SepNamdar @DDD_Iran
@SHODOioFR
Slide 3
Slide 3 text
Who we are?
KHALED SOUF
@khaledsouf
@SoCraTes_CA
@Livifrance/@KRYcare
@ScRomandie
Slide 4
Slide 4 text
‘There are only two hard things in Computer
Science: cache invalidation and
naming things.’
Phil Karlton
@SepNamdar @KhaledSouf
Slide 5
Slide 5 text
What is the naming?
‘specify (a sum, time, or place) as something
desired, suggested, or decided on’
Oxford languages
@SepNamdar @KhaledSouf
Slide 6
Slide 6 text
Naming is
@SepNamdar @KhaledSouf
● A team activity
● A set of rules
● A tool to communicate
Collaborative Modeling
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
“A specification / title / index for a thing
to understand what it does
without going deep inside it.”
our humble definition
Naming is
@SepNamdar @KhaledSouf
Slide 9
Slide 9 text
Why naming?
‘Programs are meant to be read
by humans and only incidentally
for computers to execute.’
Donald Knuth
@SepNamdar @KhaledSouf
Slide 10
Slide 10 text
Why naming?
@SepNamdar @KhaledSouf
Slide 11
Slide 11 text
How to name ?
@SepNamdar @KhaledSouf
“Conceptual Contour”
Slide 12
Slide 12 text
What is the intent ?
@SepNamdar @KhaledSouf
Slide 13
Slide 13 text
What is the intent, now ?
@SepNamdar @KhaledSouf
Slide 14
Slide 14 text
What is the intent, now ?
What is the intent of the system
(expressed as names)
What are the use cases
(expressed as verbs)
All technical stuff
@SepNamdar @KhaledSouf
Infrastructure Service
RecruiterInfra
or
RecruiterMapping
or
RecruiterXXX
Recruiters
1 2
RecruitersCalendar
3
Technical Suffix Plural Domain Term
@SepNamdar @KhaledSouf
Slide 21
Slide 21 text
Infrastructure Service
RecruiterInfra
or
RecruiterMapping
or
RecruiterXXX
Recruiters
1 2
RecruitersCalendar
3
Technical Suffix Plural Domain Term
@SepNamdar @KhaledSouf
“Intention-Revealing Interfaces”
Slide 22
Slide 22 text
Application Service
InterviewService PlanInterview
PlanInterviewAction
or
PlanInterviewUseCase
Suffix Service Domain Term Suffix Action/UseCase
1 2 3
@SepNamdar @KhaledSouf
Slide 23
Slide 23 text
Application Service
InterviewService PlanInterview
PlanInterviewAction
or
PlanInterviewUseCase
Suffix Service Domain Term
1 2 3
@SepNamdar @KhaledSouf
Suffix Action/UseCase
Slide 24
Slide 24 text
Domain Service
PlanInterviewService InterviewPlanifier
1 2
Suffix Service Domain Term
@SepNamdar @KhaledSouf
Slide 25
Slide 25 text
Domain Service
PlanInterviewService InterviewPlanifier
1 2
Suffix Service Domain Term
@SepNamdar @KhaledSouf
4 - Mixing contexts
Sourcing
- Skills
- Source of Contact
Interview
- Skills
- Name
- Experiences
- Soft Skills
Contracting
- Name
- Address
- Social Number
- Salary
@SepNamdar @KhaledSouf
Candidate
Slide 33
Slide 33 text
4 - Mixing contexts
Sourcing
- Skills
- Source of
Contact
Interview
- Skills
- Name
- Experiences
- Soft Skills
Contracting
- Name
- Address
- Social Number
- Salary
@SepNamdar @KhaledSouf
Candidate Candidate Candidate
Slide 34
Slide 34 text
4 - Mixing contexts
Sourcing
Someone found
on a recruitment
network with a
CV that matches
search criteria
Interview
Someone who should
be evaluated by a
technical recruiter
Contracting
Someone who
passed his interview
successfully and will
be integrated to the
company
@SepNamdar @KhaledSouf
Candidate Candidate Candidate
Slide 35
Slide 35 text
4 - Mixing contexts
Sourcing
- Skills
- Source of
Contact
Interview
- Skills
- Name
- Experiences
- Soft Skills
Contracting
- Name
- Address
- Social Number
- Salary
Prospect Candidate Employee
@SepNamdar @KhaledSouf
Prospect Candidate Employee
Slide 36
Slide 36 text
7 - Translate Ubiquitous Language
@SepNamdar @KhaledSouf
Slide 37
Slide 37 text
Domain Model
Final word
@SepNamdar @KhaledSouf
Ubiquitous
Language
Expressed as
Documentation
Expressed as
Conversation
Expressed as Diagram
Expressed as Code
The Truth
Slide 38
Slide 38 text
‘if you want me to talk for 60 minutes, give
me 5 minutes to prepare; if you want me to
talk for 5 minutes, give me a few hours to
prepare’
Vaughn Vernon - Domain-Driven Design Distilled
@SepNamdar @KhaledSouf
Final word