Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Fundamental Domain-Driven Design for Microservices
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Oliver Drotbohm
September 30, 2016
Programming
630
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fundamental Domain-Driven Design for Microservices
Slides of the talk I gave at JUG Saxony Day 2016.
@springcentral
Oliver Drotbohm
September 30, 2016
More Decks by Oliver Drotbohm
See All by Oliver Drotbohm
What's new in Spring Modulith?
olivergierke
1
360
Domain-centric? Why Hexagonal and Onion Architecture Are Answers to the Wrong Question
olivergierke
4
2.1k
It Takes Two to Tango – Designing Module Interactions in Modulithic Spring Applications
olivergierke
5
860
Bottom-Up Architecture – Bridging the Achitecture Code Gap
olivergierke
4
1.1k
Spring Modulith – A Deep Dive
olivergierke
9
5.9k
Spring for the Architecturally Curious Developer
olivergierke
5
2k
Spring Boot 3 & Spring Framework 6
olivergierke
4
2.1k
Architecturally-evident Java Applications with jMolecules
olivergierke
9
3.2k
A Deep Dive into Spring Application Events
olivergierke
12
3.6k
Other Decks in Programming
See All in Programming
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
180
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.8k
Intent as Code
shoppingjaws
6
1k
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
140
Webの地図
yosuke_furukawa
PRO
6
4.6k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
170
一人だけ、Kiroが静止する日
hideg
0
120
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
3.4k
Jetpack Compose メカニズム
skydoves
0
440
アクセシビリティから考える情報設計
high_g_engineer
0
380
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
420
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
280
It's Worth the Effort
3n
188
29k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
First, design no harm
axbom
PRO
2
1.3k
Abbi's Birthday
coloredviolet
4
10k
The SEO identity crisis: Don't let AI make you average
varn
0
560
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
Building a Scalable Design System with Sketch
lauravandoore
464
34k
A Tale of Four Properties
chriscoyier
163
24k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Transcript
© 2014 SpringOne 2GX. All rights reserved. Do not distribute
without permission. DOMAIN-DRIVEN DESIGN / OLIVERGIERKE ƻ
[email protected]
FUNDAMENTAL FOR MICROSERVICES
2
None
4 http://www.infoq.com/minibooks/domain-driven-design-quickly
5
Implementing Domain-Driven Design 6
Value objects 7
Stringly typed code 8 public class Customer { private Long
id; private String firstname, lastname, email; … }
Stringly typed code 9 public class SomeService { public void
createUser(String firstname, String lastname, String email) { … } }
10 public class Customer { private Long id; private Firstname
firstname; private Lastname lastname; private EmailAddress emailAddress; … }
Value Objects are a PITA to build in some languages.
11
Still, they’re worth it. 12 See „Power Use of Value
Objects in DDD“ by Dan Bergh Johnsson.
Lombok — putting the spice back into Java. 13
14 @Value public class Customer { UUID id = UUID.randomUUID();
Firstname firstname; Lastname lastname; EmailAddress email; @Value static class EmailAddress { String value; } }
Entities & Aggregates 16
17 Order LineItem Product Invoice Customer Payment Address Email
17 Order LineItem Product Invoice Customer Payment Address Email
Persistence technology VS. Domain model 18
Aggregate = Entity + Repository 19
20 Order LineItem Product Invoice Customer Payment Address Email
Bounded Context 21
Order LineItem Product Invoice Customer Payment Address
23 Shipping Accounting Catalog Orders User Registration
23 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
Domain-Driven Design & Monoliths 24
Avoid technologies that get in your way. 25
How to enforce context boundaries? 26
What about consistency? 27
References between Bounded Contexts? 28
Domain Events 29
30 Level 0: No events at all
30 Level 0: No events at all Level 1: Explicit
operations
If you’re calling two setters in a row, you’re missing
a concept. 31
32 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events
State transitions become domain events. 33
34 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events Level 3: Event Sourcing
Domain-Driven Design & Microservices 35
Bounded contexts define system boundaries. 36
37 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
38 Shipping Accounting Catalog Orders User Registration Accounting Shipping
39 Shipping Accounting Catalog Orders User Registration Accounting Shipping HTTP
Messaging
Architecture is less likely to deteriorate as it’s harder to
violate boundaries. 40
Restructuring service boundaries is much harder. 41
Inter-Context communication becomes remote communication. 42
Accept and embrace eventual consistency between services. 43
Domain Events 44
REST & Messaging 45
Domain events become state transitions. 46
Hypermedia for state transition and explicit events. 47
Thanks! 48