SlideShare a Scribd company logo
1 of 39
DDD DISTILLED
JONATHAN WYLLIEM
DDD IN A NUTSHELL
JONATHAN WYLLIEM
WHAT IS DOMAIN ??
WHAT IS DDD?
•It is a way of thinking and set of rules for
developing software with complicated
domains.
•Model driven software design approach to
tackle complexity of software project.
•Collection of principles and patterns that
help craft elegant systems.
DEFINITIONS
•Domain - A sphere of knowledge or
activity.
•Model – Abstracts domain in simple way.
Distilled form of knowledge, assumptions,
rules and choices.
THREE LAYER CAKE
5 LAYER CAKE
PEOPLE TRY EATING WHOLE CAKE
PRINCIPLES
•Speaks Ubiquitous Language
•Explore models with collaboration with
domain practitioners and software
practitioners.
•Focus on core domain
•Model and implementation are bound,
developers are responsible for the model.
PRINCIPLES
•Publish event when changes to aggregate
happens
UBIQUITOUS LANGUAGE
•Language structured around the domain.
•The language will be used to discuss and
will also be represented in code
•Change in ubiquitous language <=>
Change in code & model
EXPRESSING MODEL
•Model can be expressed through UML
diagrams, etc
•Design document is not the model
•Model ultimately is represented in code.
BREAK DOWN COMPLEX
MODEL
•Bounded Context – An operational
definition where model is well defined and
applicable.
•Subdomain – Part of the domain, based on
a particular conceptual decomposition of
the domain.
EXPRESS MODEL IN
SOFTWARE
•Entities
•Value Objects
•Aggregates
•Services
•Associations
EXPRESS MODEL IN
SOFTWARE
•Factories
•Repositories
•Modules
•Context Mapping
ENTITIES
•Object’s identities remains same
•Distinguishable from other object having
same attr
•Attributes of entity are mutable
•Entities should have behavior
•NO PERSISTENCE BEHAVIOR
VALUE OBJECTS
•Things that does not have uniqueness
•Equal to other value object if value is
same
•Value object are immutable
•Example: Money, Address, DTO
AGGREGATES
•Cluster of entity of value object. Treated
as single unit
•Each aggregate has a root entity known as
Aggregate Root
•External object may only reference to the
root
•Internal aggregate can only be change
AGGREGATES
•SalesInvoice
- TransactionLine 1
- TransactionLine 2
- TransactionLine 3
- TransactionLine 4
ASSOCIATIONS
•Impose traversal direction
•Add a qualifier, reduce multiplicity
•Eliminate non essential associations
•Both a gift and a curse in Rails
SERVICES
•Application services: CSV Exporter
•Domain services: Debit / credit account
balance
•Infrastructure services: Send email
services
DOMAIN SERVICES
•Domain Services is business logic, not
part of entity or value object
•Services manipulate multiple entity or
value object
•Services are stateless
•Parameter and result are domain object
FACTORIES
•Model responsible creating other object
•Create and manage complex domain
object (aggregate root)
REPOSITORIES
•Encapsulate data persistence
•Clean seperation of domain and data store
layer
•May encapsulate multiple fetch strategy,
caching, NoSQL, SQL
•One repository per aggregate
MODULES
•Break up complex domain
•High cohesion within module, loose
coupling between module
•Part of ubiquitous language
•Helps with decoupling
•Extensible
CONTEXT MAPPING
•Mapping context point between bounded
context
•Shared kernel
•Customer/Supplier
•Conformist
•ACL
NOT SAME
•Subdomain - decomposition of domain
•Module – decomposition of model &
associated software
•Aggregate – Decomposition of run time
data
•Service – Decomposition of functionality
•Bounded context – Linguistic barrier
NOW WHAT ??
•Because we put bounded context to the
application, data query and aggregation
becomes harder
CQRS
•Needs to make changes to data and to
query data is different.
•To make changes to data we need
complex long validation
LITTLE BIT OF ONION
RING•Out of topic
•Often pair together with DDD
Good system enables average
people to achieve great things.
Bad system makes great people do
normal things.

More Related Content

Similar to Domain Driven Design Ruby Ways - JURNAL 05/10/2017

Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Mark Windholtz
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsMark Windholtz
 
Domain Driven Design - Building Blocks
Domain Driven Design - Building BlocksDomain Driven Design - Building Blocks
Domain Driven Design - Building BlocksMark Windholtz
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseKevin Mas Ruiz
 
IBM InterConnect 2015 - IIB Effective Application Development
IBM InterConnect 2015 - IIB Effective Application DevelopmentIBM InterConnect 2015 - IIB Effective Application Development
IBM InterConnect 2015 - IIB Effective Application DevelopmentAndrew Coleman
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock Steve Barbour
 
DITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part IDITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part ISuite Solutions
 
Art of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsArt of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsEl Mahdi Benzekri
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Can Pekdemir
 
Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)IT Arena
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableComsysto Reply GmbH
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use itMark Windholtz
 
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021Mufrid Krilic
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version ControlYash Mittal
 

Similar to Domain Driven Design Ruby Ways - JURNAL 05/10/2017 (20)

Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic Patterns
 
Domain Driven Design - Building Blocks
Domain Driven Design - Building BlocksDomain Driven Design - Building Blocks
Domain Driven Design - Building Blocks
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
IBM InterConnect 2015 - IIB Effective Application Development
IBM InterConnect 2015 - IIB Effective Application DevelopmentIBM InterConnect 2015 - IIB Effective Application Development
IBM InterConnect 2015 - IIB Effective Application Development
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Molecular content
Molecular contentMolecular content
Molecular content
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
DITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part IDITA Quick Start for Authors - Part I
DITA Quick Start for Authors - Part I
 
Art of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices AntipatternsArt of refactoring - Code Smells and Microservices Antipatterns
Art of refactoring - Code Smells and Microservices Antipatterns
 
Interactive DSML Design
Interactive DSML DesignInteractive DSML Design
Interactive DSML Design
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017
 
Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it2019-Nov: Domain Driven Design (DDD) and when not to use it
2019-Nov: Domain Driven Design (DDD) and when not to use it
 
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021
Aligning Bounded Contexts with Subdomains in Legacy Code - NDC Oslo 2021
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version Control
 

Recently uploaded

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Domain Driven Design Ruby Ways - JURNAL 05/10/2017