SlideShare a Scribd company logo
Domain-Driven Design
The “What” and the “Why”
Who am I?
• I’m Angga
• I’m a software developer
History
• I first “met” with Domain-Driven Design in
2009, trying to implement it.
– .. with BDD
– .. and CQRS
– .. and Event Sourcing
– .. in a mobile device!
• Typical “new toys, cool!” programmer.
– In retrospect, I was young and naïve ;).
My aim
• DDD is help me develop better software.
• I hope it can help you, too.
Word of warning
• There will be many domains visited during this
presentation.
Some (boring) things first
• What is “Domain”?
• What is “Model”?
“define:domain”
a specified sphere of activity or knowledge.
What is “Domain”?
• A specified sphere of activity or
knowledge.
• Nothing to do with “.com”, “.net”,
“.org”, etc
“define:model”
the technique of representing the real world by a computer program.
What is Model?
• the technique of representing the
real world by a computer program.
• Nothing to do with database.
• For now..
Part 1: Premises
Premises
• Computer is a very powerful tool for modeling
• Modeling is hard and takes time
• Language shapes the way we think
Premises
• Computer is a very powerful tool for modeling
• Modeling is hard and takes time
• Language shapes the way we think
Computer is a very powerful tool for
modeling
Let’s take a walk in to the
domain of art ..
Painting and modeling
• Painting has the ability to model everything,
from real concept to abstract concept.
• Art’s scale of styles:
– Realism on one end
– Abstractionism on the other end
– Expressionism in between
Art’s scale of styles
Realism

“Girl with a Pearl Earring”
Abstractionism

“The Persistence of Time”
“The Persistence of Time”
Expressionism, somewhere in the
middle

Affandi’s self-portrait
• But what does it has to do with software
development?
• Software also has “scale of styles”.
Abstract: Flappy bird
Abstract: Super Mario Bros.
Realism: Financial Software
So, what’s the different?
• Computer is (arguably) more powerful!
“Why Software is Eating the World”
(2011)
• Software companies dominance over hardware
companies
– A software company bought hardware company
(Google bought Motorola)
– Virtual stores crumples “hardware” stores (Amazon,
Netflix)
• Even “physical” company uses software for their
unfair advantage
– FedEx is best thought of as a software network that
happens to have trucks, planes and distribution hubs
attached.
• Computer is a very powerful modeling tool.
Premises
• Computer is a very powerful tool for modeling
• Modeling is hard and takes time
• Language shapes the way we think
Modeling is hard and takes time
Let’s take a walk in to the
domain of cartography..
Ancient Chinese map
Ancient Chinese map
Old world map
Modern “map”
• Again, what does it have to do with the
software development?
“There are known knowns” problem
• The knowing phase.
– The known knowns.
– The known unknowns.
– The unknown unknowns.
• Ancient Chinese explorers doesn’t know about
Americas continents.
• European explorers doesn’t know about
Australia continent.
Example: my first effort to learn web
development (~2004)
• The known knowns
– I know basic stuff how to use a computer.
• The known unknowns
– I know I have to learn HTML+CSS.
– I know I have to learn PHP.
• The unknown unknowns
– I need to install Apache.
– I need to pick a PHP version.
– I need to learn MySQL.
– I need to install PHP extension.
– ..
The danger of unknown unknowns
• Examples (totally made up):
– “You can’t book a cleaning service in holiday”
• “Unless it’s public leave holiday”
– “Unless it’s after new year’s eve holiday”
• Modeling is hard and takes time
Premises
• Computer is a very powerful tool for modeling
• Modeling is hard and takes time
• Language shapes the way we think
Language shapes the way we think
Let’s take a walk in to the
domain of linguistics..
Sapir-Whorf Hypothesis
• “[..] the idea that differences in the way
languages encode cultural and cognitive
categories affect the way people think, so that
speakers of different languages will tend to
think and behave differently depending on the
language they use.”
Examples
• English: He ate the melon.
• Indonesia: Dia memakan melon.
• At least, two facts are lost:
– The gender
– The time
• Study have shown that children who speaks
languages with gender bias know their gender
faster than the children who speaks language
without one (Guiora, 1983)
• What this means: Children in England knows
their gender before children in Indonesia.
Javanese expressiveness
• Jatuh ke belakang: NGGEBLAK
• Jatuh dari atas: CEBLOK
• Jatuh ke depan: NYUNGSEP
• Jatuh terlempar: NJUNGKEL
• Jatuh tersandung: NJLUNGUP
• Jatuh meluncur: NDLOSOR
• Nyaris jatuh: MINGKLIK-MINGKLIK
• Language shapes the way we think!
Premises
• Computer is a very powerful tool for modeling
• Modeling is hard and takes time
• Language shapes the way we think
Domain-Driven Design
What DDD looks like?
• In the communication between team-
members.
• In the code.
What DDD looks like?
• In the communication between team-
members.
• In the code.
Comparison
• Two dialogs between the user (domain expert)
and the developer.
• Domain: Cargo Shipping
• Problem: How to efficiently generate
Itinerary?
Core concepts
• Cargo
• Custom Clearance Point
• Route
• Route Specification
• Itinerary
In the Communication
(A)
• USER: So when we change the customs clearance
point, we need to redo the whole routing plan.
• DEVELOPER: Right. We'll delete all the rows in the
shipment table with that cargo id, then we'll pass
the origin, destination and the new customs
clearance point into the Routing Service and it
will repopulate the table. We'll have to have a
Boolean in the Cargo so we'll know there is data
in the shipment table.
In the Communication (continued)
(A)
• USER: Delete the rows? Ok, whatever. Anyway, if
we didn't have a customs clearance point at all
before, we'll have to do the same thing.
• DEVELOPER: Sure, any time you change the
origin, destination or customs clearance point (or
enter one for the first time) we'll check to see if
we have shipment data and then we'll delete it
and then let the Routing Service regenerate it.
In the Communication (continued)
(A)
• USER: Of course, if the old customs clearance just happened to be
the right one, we wouldn't want to do that.
• DEVELOPER: Oh, no problem. It is easier to just make the Routing
Service redo the loads and unloads every time.
• USER: Yes, but it is extra work for us to make all the supporting
plans for a new itinerary, so we don't want to reroute unless the
change necessitates it.
• DEVELOPER: Ugh. Well, then, if you are entering a customs
clearance point for the first time, we'll have to query the table to
find the old derived customs clearance point, and then compare it
to the new one. Then we'll know if we need to redo it.
In the Communication
(B)
• USER: So when we change the customs
clearance point, we need to redo the whole
routing plan.
• DEVELOPER: Right. When you change any of
the attributes in the Route Specification, we'll
delete the old Itinerary and ask the Routing
Service to generate a new one based on the
new Route Specification.
In the Communication (continued)
(B)
• USER: If we hadn't specified a customs
clearance point at all before, we'll have to do
the same thing.
• DEVELOPER: Sure, any time you change
anything in the Route Specification, we'll
regenerate the Itinerary. That includes
entering something for the first time.
In the Communication (continued)
(B)
• USER: Of course, if the old customs clearance just happened to be
the right one, we wouldn't want to do that.
• DEVELOPER: Oh, no problem. It is easier to just make the Routing
Service redo the Itinerary every time.
• USER: Yes, but it is extra work for us to make all the supporting
plans for a new Itinerary, so we don't want to reroute unless the
change necessitates it.
• DEVELOPER: Oh. Then we'll have to add some functionality to the
Route Specification. Then, whenever you change anything in the
Specification, we'll see if the Itinerary still satisfies the
Specification. If it doesn't, we'll have the Routing Service
regenerate the Itinerary.
In the Code
• Domain: Time and Date
• Problem: How to generates due date based on
the work date.
– Rule: payment is due 30 days after the end of the
month in which the work is done.
In the Code
(A)
In the Code
(B)
What DDD emphasizes on?
• The binding of Model
• The Iterative improvement of the Model
• The expressiveness of the Model
What DDD emphasizes on?
• The binding of Model
• The Iterative improvement of the Model
• The expressiveness of the Model
The binding of Model
• Remember Sapir-Whorf Hypothesis?
What DDD emphasizes on?
• The binding of Model
• The Iterative improvement of the Model
• The expressiveness of the Model
The iterative improvement of the
Model
• Remember the unknown-unknown zone?
– The only way to know what’s in there is by
continuous learning.
– And then applied it to the Model.
What DDD emphasizes on?
• The binding of Model
• The Iterative improvement of the Model
• The expressiveness of the Model
The expressiveness of the Model
• It’s like the Time and Code example.
• Readable is good, but expressive is better.
The expressiveness of the Model
• But there are better examples
– You already use them!
• The “holy grail” of Domain-Driven Design is
Domain Specific Language
– HTML + CSS (Domain: document representation
on the web)
– SQL (Domain: RDMS manipulation)
– Regex (Domain: String processing)
– etc
When to use DDD
• When the domain is non-trivial (or even
complex).
– To-Do List doesn’t count ;)
• When the developer has access to the Domain
Expert.
So, what is DDD and why?
• Domain-Driven Design:
Tackling Complexity in
the Heart of Software.
So, what is DDD and why?
• The heart of software is its ability to solve
domain-related problem for the user. (Evans,
2003)
• Two types of complexity:
– Essential complexity
– Accidental complexity
Accidental Complexity
• Twitter
Essential Complexity
• Financial Software
• Your software? ;)
So, what is DDD and why?
• Why DDD?
– Because we need to tackle complexity on the
domain.
• What is DDD?
– A set of thinking tools to tackle complexity on the
domain.
The Bad News
• DDD takes a long time
– Remember the map? It takes hundreds of years.
– Many many times of refinements.
• Think of constantly refactoring.
• “Your problem, of course, is to figure out
where on that x axis your application lies. The
good news is that I can say that you should
use a Domain Model whenever the complexity
of your domain logic is greater than 7.42. The
bad news is that nobody knows how to
measure the complexity of domain logic.”
(Fowler, 2003)
• “People are overly interested about some of
the DDD patterns like Entities, Value objects
and Events, Domain Events, these things have
a certain manifestation in the object-oriented
world, but the core of Domain-Driven Design
is the Ubiquitous Languages.” (Evans, 2003)
Domain-Driven Design: The "What" and the "Why"

More Related Content

What's hot

Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011
thinkddd
 
Domain driven design in a nutshell
Domain driven design in a nutshellDomain driven design in a nutshell
Domain driven design in a nutshell
Toni Esteves
 

What's hot (20)

Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Domain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledDomain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) Distilled
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
Domain driven design in a nutshell
Domain driven design in a nutshellDomain driven design in a nutshell
Domain driven design in a nutshell
 
DDD Basics: Bounded Contexts, Modelling - Kortrijk Edition
DDD Basics: Bounded Contexts, Modelling - Kortrijk EditionDDD Basics: Bounded Contexts, Modelling - Kortrijk Edition
DDD Basics: Bounded Contexts, Modelling - Kortrijk Edition
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
DDD - What, why, how?
DDD - What, why, how?DDD - What, why, how?
DDD - What, why, how?
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
DDD Strategic Design - Context Maps - Paulo Clavijo - April 2018
DDD Strategic Design - Context Maps - Paulo Clavijo - April 2018DDD Strategic Design - Context Maps - Paulo Clavijo - April 2018
DDD Strategic Design - Context Maps - Paulo Clavijo - April 2018
 
Domain Driven Design in an Agile World
Domain Driven Design in an Agile WorldDomain Driven Design in an Agile World
Domain Driven Design in an Agile World
 

Viewers also liked

Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012
Bradley Holt
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 
Why Domain-Driven Design Matters
Why Domain-Driven Design MattersWhy Domain-Driven Design Matters
Why Domain-Driven Design Matters
Mathias Verraes
 

Viewers also liked (18)

Ddd part 2 modelling qiscus
Ddd part 2   modelling qiscusDdd part 2   modelling qiscus
Ddd part 2 modelling qiscus
 
Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012
 
An Introduction to Domain Driven Design for Product Managers
An Introduction to Domain Driven Design for Product ManagersAn Introduction to Domain Driven Design for Product Managers
An Introduction to Domain Driven Design for Product Managers
 
Agile development and domain driven design
Agile development and domain driven designAgile development and domain driven design
Agile development and domain driven design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
 
Domain-driven design
Domain-driven designDomain-driven design
Domain-driven design
 
A visual introduction to Event Sourcing and CQRS
A visual introduction to Event Sourcing and CQRSA visual introduction to Event Sourcing and CQRS
A visual introduction to Event Sourcing and CQRS
 
Domain Driven Design and Hexagonal Architecture with Rails
Domain Driven Design and Hexagonal Architecture with RailsDomain Driven Design and Hexagonal Architecture with Rails
Domain Driven Design and Hexagonal Architecture with Rails
 
Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven Design
 
Why Domain-Driven Design Matters
Why Domain-Driven Design MattersWhy Domain-Driven Design Matters
Why Domain-Driven Design Matters
 
Designing APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven DesignDesigning APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven Design
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVC
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
From C to Q one event at a time: Event Sourcing illustrated
From C to Q one event at a time: Event Sourcing illustratedFrom C to Q one event at a time: Event Sourcing illustrated
From C to Q one event at a time: Event Sourcing illustrated
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 

Similar to Domain-Driven Design: The "What" and the "Why"

Emperors new clothes_digitalbarn_output_snakk
Emperors new clothes_digitalbarn_output_snakkEmperors new clothes_digitalbarn_output_snakk
Emperors new clothes_digitalbarn_output_snakk
kevinjohngallagher
 
Emperors new clothes - digitalbarn2012
Emperors new clothes - digitalbarn2012Emperors new clothes - digitalbarn2012
Emperors new clothes - digitalbarn2012
kevinjohngallagher
 

Similar to Domain-Driven Design: The "What" and the "Why" (20)

C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
Deployment is the new build
Deployment is the new buildDeployment is the new build
Deployment is the new build
 
Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)
Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)
Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)
 
李俊良/Feature Engineering in Machine Learning
李俊良/Feature Engineering in Machine Learning李俊良/Feature Engineering in Machine Learning
李俊良/Feature Engineering in Machine Learning
 
Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)
 
What is spatial sql
What is spatial sqlWhat is spatial sql
What is spatial sql
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
 
Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...Speaking 'Development Language' (Or, how to get your hands dirty with technic...
Speaking 'Development Language' (Or, how to get your hands dirty with technic...
 
CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a Program
 
Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?
 
6.1 GeospatialWeb101.pptx.pptx
6.1 GeospatialWeb101.pptx.pptx6.1 GeospatialWeb101.pptx.pptx
6.1 GeospatialWeb101.pptx.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
2023-My AI Experience - Colm Dunphy.pdf
2023-My AI Experience - Colm Dunphy.pdf2023-My AI Experience - Colm Dunphy.pdf
2023-My AI Experience - Colm Dunphy.pdf
 
Implementing Modernization by Trevor Perry
Implementing Modernization by Trevor PerryImplementing Modernization by Trevor Perry
Implementing Modernization by Trevor Perry
 
OOP -interface and objects.pptx
OOP -interface and objects.pptxOOP -interface and objects.pptx
OOP -interface and objects.pptx
 
Emperors new clothes_digitalbarn_output_snakk
Emperors new clothes_digitalbarn_output_snakkEmperors new clothes_digitalbarn_output_snakk
Emperors new clothes_digitalbarn_output_snakk
 
Emperors new clothes - digitalbarn2012
Emperors new clothes - digitalbarn2012Emperors new clothes - digitalbarn2012
Emperors new clothes - digitalbarn2012
 
Emperors new clothes_jab
Emperors new clothes_jabEmperors new clothes_jab
Emperors new clothes_jab
 
Carpe Digital
Carpe DigitalCarpe Digital
Carpe Digital
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014
 

More from bincangteknologi

More from bincangteknologi (8)

TechTalk #86 : ECMAScript 6 by Afief S
TechTalk #86 : ECMAScript 6 by Afief STechTalk #86 : ECMAScript 6 by Afief S
TechTalk #86 : ECMAScript 6 by Afief S
 
TechTalk #85 : Latest Frontend Technologies
TechTalk #85 : Latest Frontend TechnologiesTechTalk #85 : Latest Frontend Technologies
TechTalk #85 : Latest Frontend Technologies
 
Intro to Chef
Intro to ChefIntro to Chef
Intro to Chef
 
Qiscus enterprice for Hotels
Qiscus enterprice for HotelsQiscus enterprice for Hotels
Qiscus enterprice for Hotels
 
TechTalk #70 : REAL PROGRAMMER USE REGEX
TechTalk #70 : REAL PROGRAMMER USE REGEXTechTalk #70 : REAL PROGRAMMER USE REGEX
TechTalk #70 : REAL PROGRAMMER USE REGEX
 
TechTalk #69 : How to setup and run laravel apps inside vagrant
TechTalk #69 : How to setup and run laravel apps inside vagrantTechTalk #69 : How to setup and run laravel apps inside vagrant
TechTalk #69 : How to setup and run laravel apps inside vagrant
 
TechTalk #67 : Introduction to Ruby and Sinatra
TechTalk #67 : Introduction to Ruby and SinatraTechTalk #67 : Introduction to Ruby and Sinatra
TechTalk #67 : Introduction to Ruby and Sinatra
 
Arduino + Android
Arduino + AndroidArduino + Android
Arduino + Android
 

Recently uploaded

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Recently uploaded (20)

Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
How To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdfHow To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdf
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Benefits of Employee Monitoring Software
Benefits of  Employee Monitoring SoftwareBenefits of  Employee Monitoring Software
Benefits of Employee Monitoring Software
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 

Domain-Driven Design: The "What" and the "Why"

  • 2. Who am I? • I’m Angga • I’m a software developer
  • 3. History • I first “met” with Domain-Driven Design in 2009, trying to implement it. – .. with BDD – .. and CQRS – .. and Event Sourcing – .. in a mobile device! • Typical “new toys, cool!” programmer. – In retrospect, I was young and naïve ;).
  • 4. My aim • DDD is help me develop better software. • I hope it can help you, too.
  • 5. Word of warning • There will be many domains visited during this presentation.
  • 6. Some (boring) things first • What is “Domain”? • What is “Model”?
  • 7. “define:domain” a specified sphere of activity or knowledge.
  • 8. What is “Domain”? • A specified sphere of activity or knowledge. • Nothing to do with “.com”, “.net”, “.org”, etc
  • 9. “define:model” the technique of representing the real world by a computer program.
  • 10. What is Model? • the technique of representing the real world by a computer program. • Nothing to do with database. • For now..
  • 12. Premises • Computer is a very powerful tool for modeling • Modeling is hard and takes time • Language shapes the way we think
  • 13. Premises • Computer is a very powerful tool for modeling • Modeling is hard and takes time • Language shapes the way we think
  • 14. Computer is a very powerful tool for modeling Let’s take a walk in to the domain of art ..
  • 15. Painting and modeling • Painting has the ability to model everything, from real concept to abstract concept. • Art’s scale of styles: – Realism on one end – Abstractionism on the other end – Expressionism in between
  • 18. “Girl with a Pearl Earring”
  • 22. Expressionism, somewhere in the middle 
  • 24. • But what does it has to do with software development?
  • 25. • Software also has “scale of styles”.
  • 29. So, what’s the different? • Computer is (arguably) more powerful!
  • 30.
  • 31.
  • 32. “Why Software is Eating the World” (2011) • Software companies dominance over hardware companies – A software company bought hardware company (Google bought Motorola) – Virtual stores crumples “hardware” stores (Amazon, Netflix) • Even “physical” company uses software for their unfair advantage – FedEx is best thought of as a software network that happens to have trucks, planes and distribution hubs attached.
  • 33. • Computer is a very powerful modeling tool.
  • 34. Premises • Computer is a very powerful tool for modeling • Modeling is hard and takes time • Language shapes the way we think
  • 35. Modeling is hard and takes time Let’s take a walk in to the domain of cartography..
  • 40. • Again, what does it have to do with the software development?
  • 41. “There are known knowns” problem • The knowing phase. – The known knowns. – The known unknowns. – The unknown unknowns. • Ancient Chinese explorers doesn’t know about Americas continents. • European explorers doesn’t know about Australia continent.
  • 42. Example: my first effort to learn web development (~2004) • The known knowns – I know basic stuff how to use a computer. • The known unknowns – I know I have to learn HTML+CSS. – I know I have to learn PHP. • The unknown unknowns – I need to install Apache. – I need to pick a PHP version. – I need to learn MySQL. – I need to install PHP extension. – ..
  • 43.
  • 44. The danger of unknown unknowns • Examples (totally made up): – “You can’t book a cleaning service in holiday” • “Unless it’s public leave holiday” – “Unless it’s after new year’s eve holiday”
  • 45. • Modeling is hard and takes time
  • 46. Premises • Computer is a very powerful tool for modeling • Modeling is hard and takes time • Language shapes the way we think
  • 47. Language shapes the way we think Let’s take a walk in to the domain of linguistics..
  • 48. Sapir-Whorf Hypothesis • “[..] the idea that differences in the way languages encode cultural and cognitive categories affect the way people think, so that speakers of different languages will tend to think and behave differently depending on the language they use.”
  • 49.
  • 50. Examples • English: He ate the melon. • Indonesia: Dia memakan melon. • At least, two facts are lost: – The gender – The time
  • 51. • Study have shown that children who speaks languages with gender bias know their gender faster than the children who speaks language without one (Guiora, 1983) • What this means: Children in England knows their gender before children in Indonesia.
  • 52. Javanese expressiveness • Jatuh ke belakang: NGGEBLAK • Jatuh dari atas: CEBLOK • Jatuh ke depan: NYUNGSEP • Jatuh terlempar: NJUNGKEL • Jatuh tersandung: NJLUNGUP • Jatuh meluncur: NDLOSOR • Nyaris jatuh: MINGKLIK-MINGKLIK
  • 53. • Language shapes the way we think!
  • 54. Premises • Computer is a very powerful tool for modeling • Modeling is hard and takes time • Language shapes the way we think
  • 55.
  • 57. What DDD looks like? • In the communication between team- members. • In the code.
  • 58. What DDD looks like? • In the communication between team- members. • In the code.
  • 59. Comparison • Two dialogs between the user (domain expert) and the developer. • Domain: Cargo Shipping • Problem: How to efficiently generate Itinerary?
  • 60.
  • 61. Core concepts • Cargo • Custom Clearance Point • Route • Route Specification • Itinerary
  • 62. In the Communication (A) • USER: So when we change the customs clearance point, we need to redo the whole routing plan. • DEVELOPER: Right. We'll delete all the rows in the shipment table with that cargo id, then we'll pass the origin, destination and the new customs clearance point into the Routing Service and it will repopulate the table. We'll have to have a Boolean in the Cargo so we'll know there is data in the shipment table.
  • 63.
  • 64. In the Communication (continued) (A) • USER: Delete the rows? Ok, whatever. Anyway, if we didn't have a customs clearance point at all before, we'll have to do the same thing. • DEVELOPER: Sure, any time you change the origin, destination or customs clearance point (or enter one for the first time) we'll check to see if we have shipment data and then we'll delete it and then let the Routing Service regenerate it.
  • 65.
  • 66. In the Communication (continued) (A) • USER: Of course, if the old customs clearance just happened to be the right one, we wouldn't want to do that. • DEVELOPER: Oh, no problem. It is easier to just make the Routing Service redo the loads and unloads every time. • USER: Yes, but it is extra work for us to make all the supporting plans for a new itinerary, so we don't want to reroute unless the change necessitates it. • DEVELOPER: Ugh. Well, then, if you are entering a customs clearance point for the first time, we'll have to query the table to find the old derived customs clearance point, and then compare it to the new one. Then we'll know if we need to redo it.
  • 67. In the Communication (B) • USER: So when we change the customs clearance point, we need to redo the whole routing plan. • DEVELOPER: Right. When you change any of the attributes in the Route Specification, we'll delete the old Itinerary and ask the Routing Service to generate a new one based on the new Route Specification.
  • 68.
  • 69. In the Communication (continued) (B) • USER: If we hadn't specified a customs clearance point at all before, we'll have to do the same thing. • DEVELOPER: Sure, any time you change anything in the Route Specification, we'll regenerate the Itinerary. That includes entering something for the first time.
  • 70.
  • 71. In the Communication (continued) (B) • USER: Of course, if the old customs clearance just happened to be the right one, we wouldn't want to do that. • DEVELOPER: Oh, no problem. It is easier to just make the Routing Service redo the Itinerary every time. • USER: Yes, but it is extra work for us to make all the supporting plans for a new Itinerary, so we don't want to reroute unless the change necessitates it. • DEVELOPER: Oh. Then we'll have to add some functionality to the Route Specification. Then, whenever you change anything in the Specification, we'll see if the Itinerary still satisfies the Specification. If it doesn't, we'll have the Routing Service regenerate the Itinerary.
  • 72.
  • 73. In the Code • Domain: Time and Date • Problem: How to generates due date based on the work date. – Rule: payment is due 30 days after the end of the month in which the work is done.
  • 74.
  • 77. What DDD emphasizes on? • The binding of Model • The Iterative improvement of the Model • The expressiveness of the Model
  • 78. What DDD emphasizes on? • The binding of Model • The Iterative improvement of the Model • The expressiveness of the Model
  • 79. The binding of Model • Remember Sapir-Whorf Hypothesis?
  • 80.
  • 81. What DDD emphasizes on? • The binding of Model • The Iterative improvement of the Model • The expressiveness of the Model
  • 82. The iterative improvement of the Model • Remember the unknown-unknown zone? – The only way to know what’s in there is by continuous learning. – And then applied it to the Model.
  • 83. What DDD emphasizes on? • The binding of Model • The Iterative improvement of the Model • The expressiveness of the Model
  • 84. The expressiveness of the Model • It’s like the Time and Code example. • Readable is good, but expressive is better.
  • 85. The expressiveness of the Model • But there are better examples – You already use them! • The “holy grail” of Domain-Driven Design is Domain Specific Language – HTML + CSS (Domain: document representation on the web) – SQL (Domain: RDMS manipulation) – Regex (Domain: String processing) – etc
  • 86. When to use DDD • When the domain is non-trivial (or even complex). – To-Do List doesn’t count ;) • When the developer has access to the Domain Expert.
  • 87. So, what is DDD and why? • Domain-Driven Design: Tackling Complexity in the Heart of Software.
  • 88. So, what is DDD and why? • The heart of software is its ability to solve domain-related problem for the user. (Evans, 2003)
  • 89. • Two types of complexity: – Essential complexity – Accidental complexity
  • 91. Essential Complexity • Financial Software • Your software? ;)
  • 92. So, what is DDD and why? • Why DDD? – Because we need to tackle complexity on the domain. • What is DDD? – A set of thinking tools to tackle complexity on the domain.
  • 93. The Bad News • DDD takes a long time – Remember the map? It takes hundreds of years. – Many many times of refinements. • Think of constantly refactoring.
  • 94.
  • 95. • “Your problem, of course, is to figure out where on that x axis your application lies. The good news is that I can say that you should use a Domain Model whenever the complexity of your domain logic is greater than 7.42. The bad news is that nobody knows how to measure the complexity of domain logic.” (Fowler, 2003)
  • 96. • “People are overly interested about some of the DDD patterns like Entities, Value objects and Events, Domain Events, these things have a certain manifestation in the object-oriented world, but the core of Domain-Driven Design is the Ubiquitous Languages.” (Evans, 2003)

Editor's Notes

  1. Recent exampe
  2. Oldies example
  3. Canvas vs RAM
  4. Canvas vs RAM
  5. Taken from DDD book.