Refactoring towards 
Domain Driven Design 
DAVID BERLINER
The sources of all knowledge:
Who am I ? 
Developer at BetTech. 
I've been coding for a decade. 
@manatok
“…is a disciplined technique for 
restructuring an existing body of code, 
altering its internal structure without 
changing its external behavior.…” 
Martin Fowler
+ Adding features 
+ Shortcuts and hacks 
+ Team growth 
= increased complexity
No thanks! 
We're 
too busy.
TIME 
CUMULATIVE FUNCTIONALITY 
GOOD DESIGN 
NO DESIGN 
DESIGN PAY-OFF LINE
So... 
how do we do it?
Refactoring requires 
prioritisation
Boyscout refactoring
What is considered 
“code litter”?
Domain 
Driven 
Design
Bounded context 
Ubiquitous 
language
Define 
model 
with 
Ubiquitous 
Language 
Identify 
model 
with 
MODEL DRIVEN DESIGN 
Process 
model 
with 
Express 
model 
with 
Express 
model 
with 
Isolate 
domain 
with 
Express 
state change 
with 
Bounded 
Contexts Services Entities 
Value 
Objects 
Layered 
Architecture Events
ANTI-CORRUPTION LAYER
ANTI-CORRUPTION LAYER
final thoughts
+ You don’t have to drink ALL 
the kool-aid to benefit 
+ See the good side of 
a messy system 
+ Be consistent
Thaynouk
Refactoring for Domain Driven Design

Refactoring for Domain Driven Design