unleash your domain - jfokus · snap 4 3 2 1 6 . application services data storage domain object...
TRANSCRIPT
![Page 1: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/1.jpg)
Unleash Your Domain
Greg Young
![Page 2: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/2.jpg)
Agenda
• The Issues
• The Breakthroughs
– Explicit State Representation
– Event Storage
– Command Query Separation
– Asynchronous Context Mapping
• Summary
• Questions
![Page 3: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/3.jpg)
![Page 4: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/4.jpg)
![Page 5: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/5.jpg)
![Page 6: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/6.jpg)
![Page 7: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/7.jpg)
![Page 8: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/8.jpg)
State transitions are an important part of our problem space and should be modeled within
our domain.
![Page 9: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/9.jpg)
![Page 10: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/10.jpg)
Purchase Order
Line Items (n)
Shipping Information
![Page 11: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/11.jpg)
Cart Created
3 Items Added
Shipping Information
Added
![Page 12: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/12.jpg)
Purchase Order
AddItemCommand
ChangeAddressCommand
AddItemCommand AddItemCommand
![Page 13: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/13.jpg)
![Page 14: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/14.jpg)
Cart Created
3 Items Added
1Item Removed
Shipping Information
Added
![Page 15: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/15.jpg)
![Page 16: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/16.jpg)
6
5
4
3
2
1
7
![Page 17: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/17.jpg)
5
snap
4
3
2
1
6
![Page 18: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/18.jpg)
![Page 19: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/19.jpg)
![Page 20: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/20.jpg)
Application Services
Data Storage
Domain Object
Client
Remote Facade
Request DTO DTO returned
Send up DTO Status returned
Domain Object
![Page 21: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/21.jpg)
DTO Sent Ack/Nak Response
Request DTO DTO returned
Send DTO Back to Server
Show DTO on Screen
User Interacts With DTO
![Page 22: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/22.jpg)
Map DTO from Domain
Edit DTO in UI
Send DTO to Server
Map Data from DTO to Domain
Save Domain Object(s)
![Page 23: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/23.jpg)
Query Data
Build Commands
Send Commands to Domain
Domain Validates Commands
Save Domain Object(s)
![Page 24: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/24.jpg)
Data Storage
Application Services
Domain Object
Remote Facade
Domain Object
Client
Message Sent Ack/Nak Response
Thin Read Layer (Direct to DTO)
Remote Facade
Request DTO DTO returned
![Page 25: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/25.jpg)
Data Storage
Application Services
Domain Object
Remote Facade
Domain Object
Client
Message Sent Ack/Nak Response
Thin Read Layer (Direct to DTO)
Remote Facade
Request DTO DTO returned
Write (Command) Read (Query)
![Page 26: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/26.jpg)
A single model cannot be appropriate for reporting, searching, and transactional
behaviors…
![Page 27: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/27.jpg)
![Page 28: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/28.jpg)
![Page 29: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/29.jpg)
The model that a client needs the data in a distributed system is screen based and different
than the domain model.
![Page 30: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/30.jpg)
![Page 31: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/31.jpg)
Most queries can operate with relaxed consistency…
![Page 32: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/32.jpg)
Data Storage
Application Services
Domain Object
Remote Facade
Domain Object
Thin Read Layer (Direct to DTO)
Remote Facade
Data Storage
Client
Denormalizer -------------------
Anti Corruption
![Page 33: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/33.jpg)
![Page 34: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/34.jpg)
Getters and Setters are a domain anti-pattern.
![Page 35: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/35.jpg)
![Page 36: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/36.jpg)
![Page 37: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/37.jpg)
![Page 38: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/38.jpg)
Most Bounded Contexts can interact with relaxed consistency.
![Page 39: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/39.jpg)
![Page 40: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/40.jpg)
Using relaxed consistency allows us to increase our scalability and availability!
![Page 41: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/41.jpg)
“Man acts as though he were the shaper and master of language, while in fact it is language that is the master of man.”
![Page 42: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/42.jpg)
State transitions are an important part of our problem space and should be modeled within
our domain.
![Page 43: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/43.jpg)
Getters and Setters are a domain smell.
![Page 44: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/44.jpg)
Most Bounded Contexts can interact with relaxed consistency.
![Page 45: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/45.jpg)
A single model cannot be appropriate for reporting, searching, and transactional
behaviors…
![Page 46: Unleash Your Domain - Jfokus · snap 4 3 2 1 6 . Application Services Data Storage Domain Object Client Remote Facade Request DTO DTO returned Send up DTO Status returned Domain Object](https://reader034.vdocuments.mx/reader034/viewer/2022042418/5f34c6618dbd1d0ec06fe9b0/html5/thumbnails/46.jpg)
Questions