Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fundamental Domain-Driven Design For Microservices
Search
Oliver Drotbohm
April 19, 2016
Programming
1.1k
11
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 JAX 2016, Mayence.
@springcentral
Oliver Drotbohm
April 19, 2016
More Decks by Oliver Drotbohm
See All by Oliver Drotbohm
What's new in Spring Modulith?
olivergierke
1
340
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
840
Bottom-Up Architecture – Bridging the Achitecture Code Gap
olivergierke
4
1.1k
Spring Modulith – A Deep Dive
olivergierke
9
5.7k
Spring for the Architecturally Curious Developer
olivergierke
5
1.9k
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.5k
Other Decks in Programming
See All in Programming
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
160
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
620
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
130
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
1.1k
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
480
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
17k
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
200
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
380
Foundation Models frameworkで画像分析
ryodeveloper
1
350
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.5k
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
180
Claude Team Plan導入・ガイド
tk3fftk
0
250
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
380
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
200
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Become a Pro
speakerdeck
PRO
31
6k
Optimizing for Happiness
mojombo
378
71k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
590
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Transcript
© 2014 SpringOne 2GX. All rights reserved. Do not distribute
without permission. DOMAIN-DRIVEN DESIGN / OLIVERGIERKE ƻ
[email protected]
GRUNDLEGENDES FÜR MICROSERVICES
2
None
4 http://www.infoq.com/minibooks/domain-driven-design-quickly
Microservices ♥ Domain-Driven Design 5 Slides and video by Michael
Plöd.
6
6
Implementing Domain-Driven Design 7
Value objects 8
Stringly typed code 9 public class Customer { private Long
id; private String firstname, lastname, email; … }
Stringly typed code 10 public class SomeService { public void
createUser(String firstname, String lastname, String email) { … } }
11 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.
12
Still, they’re worth it. 13 See „Power Use of Value
Objects in DDD“ by Dan Bergh Johnsson.
Lombok — putting the spice back into Java. 14
15 @Value public class Customer { UUID id = UUID.randomUUID();
Firstname firstname; Lastname lastname; EmailAddress email; @Value static class EmailAddress { String value; } }
AutoValue 16 Project website on GitHub.
Key opponents: Mapping libraries that need to (de)serialize them. 17
Entities & Aggregates 18
Persistence technology VS. Domain model 19
Challenges with JPA: Value objects as @Entity Flat relationships
20
21 Order LineItem Product Invoice Customer Payment Address Email
21 Order LineItem Product Invoice Customer Payment Address Email
Repositories turn an entity into an aggregate root. 22
23 Order LineItem Product Invoice Customer Payment Address Email
Bounded Context 24
Order LineItem Product Invoice Customer Payment Address
26 Shipping Accounting Catalog Orders User Registration
26 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer
26 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
Domain-Driven Design & Monoliths 27
Avoid technologies that get in your way. 28
How to enforce context boundaries? 29
What about consistency? 30
References between Bounded Contexts? 31
Domain Events 32
33 Level 0: No events at all
33 Level 0: No events at all Level 1: Explicit
operations
If you’re calling two setters in a row, you’re missing
a concept. 34
35 Level 0: No events at all Level 1: Explicit
operations
35 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events
State transitions become domain events. 36
37 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events
37 Level 0: No events at all Level 1: Explicit
operations Level 2: Some operations as events Level 3: Event Sourcing
Domain-Driven Design & Microservices 38
Bounded contexts define system boundaries. 39
40 Shipping Accounting Catalog Orders User Registration Accounting Payment information
Billing Address Shipping Shipping address Customer Product
41 Shipping Accounting Catalog Orders User Registration Accounting Shipping
42 Shipping Accounting Catalog Orders User Registration Accounting Shipping HTTP
Messaging
Architecture is less likely to deteriorate as it’s harder to
violate boundaries. 43
Restructuring service boundaries is much harder. 44
Inter-Service communication becomes remote communication. 45
Accept and embrace eventual consistency between services. 46
Domain Events 47
REST & Messaging 48
Domain events become state transitions. 49
Hypermedia for state transition and explicit events. 50
Thanks! 51