Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Strategischer Anwendungsentwurf mit Domain-Driven Design
1. Strategischer Anwendungsentwurf mit
Domain-Driven Design
presented by Dennis Traub
.NET Usergroup Zentralschweiz - 18. März 2013
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
2. Now, who‘s that guy?
Dennis Traub
Founder, Owner, CEO, Single Employee of
D. Traub Software Development Consultancy
Consultant, developer, trainer, speaker
39 years old
Married, father of one
20+ years in software development
Hire me at mail@dennistraub.de
@dtraub
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
3. AGENDA
The Blue Book An Example Break Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
4. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
5. The „Blue Book“ by Eric Evans
Image Placeholder
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
6. The „Blue Book“ by Eric Evans
• Entities
• Value Objects
Tactical • Aggregates
Class • Repositories
Design • Services
• Factories
• etc.
It should be two books!
• Model Integrity
• Large-Scale Structure
• Bounded Contexts
Strategic • Core Domain
DDD • Context Maps
• Ubiquitous Language
• etc.
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
7. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
12. Domain Model
a system of abstractions that describes
selected aspects of a domain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
13. Domain Model
can be used to solve problems
related to that domain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
20. Bounded Context
an explicit boundary within which
a domain model exists
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
21. Bounded Context
inside the boundary
all terms have specific meaning
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
22. Bounded Context
these terms are part of the context‘s
ubiquitous language
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
24. Subdomains
the whole domain of the organization
is comprised of subdomains
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
25. Subdomains
they focus on only one
specific area of the whole business domain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
27. Core Domain
the distinctive part of the model,
central to the users‘ goals
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
28. Core Domain
differentiates the application and
makes it valuable
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
29. Core Domain
the most important subdomain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
30. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
35. Ambulance Flight Management
order flights from an operator
dispatch patients
assign medical staff
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
36. Bounded Contexts
1 Patiententransport-Disposition
2 Flugplanung und -durchführung
3 Personaleinsatzplanung (Flugärzte, Rettungsassistenten)
4 Patientendaten, Abrechnung, Buchhaltung
5 SOAP- oder REST-Services, Web-Oberfläche
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
37. Subdomains
1 Ambulanzflug-Disposition 6 Bodentransport
2 Flotten-Management 7 Abrechnung, Buchhaltung
3 Flugplanung 8 Anwendungsoberfläche
4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle
5 Medizinisches Personal 10 Benutzer- und Zugriffssteuerung
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
38. don‘t build a model that
works for everyone
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
39. to focus our effort and resources we ask
two questions for each subdomain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
40. 1
how complex is it?
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
41. 2
what‘s the value to our specific problem?
(if we model it ourselves)
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
42. 1. Complexity (S/M/H)
1 Ambulanzflug-Disposition 6 Bodentransport
2 Flotten-Management 7 Abrechnung, Buchhaltung
3 Flugplanung 8 Anwendungsoberfläche
4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle
5 Medizinisches Personal 10 Benutzer- und Zugriffssteuerung
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
43. 2. Value (S/M/H)
1 Ambulanzflug-Disposition 6 Bodentransport
2 Flotten-Management 7 Abrechnung, Buchhaltung
3 Flugplanung 8 Anwendungsoberfläche
4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle
5 Medizinisches Personal 10 Benutzer- und Zugriffssteuerung
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
44. the tactical Building Blocks
we don‘t use DDD
when there is no value in
formalizing the problem
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
45. we only use DDD in parts
where we get a competitive
advantage
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
46. 15 minutes
BREAK
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
47. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
48. Presentation Layer
Common Services
Infrastructure
Application Services
Domain / Business Model / BLL
DAL / O/R-Mapper
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
49. Ports & Adapters
Hexagonal Architecture
Onion Architecture
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
50. Dependency Inversion Principle (just in case)
the D in SOLID
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
51. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
52. Entity
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
53. Entity
an object
primarily defined by its identity
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
54. Entity
has a life
cycle that can
radically change its form and content
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
56. Value Object
an object that represents a
descriptive aspect of the domain
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
57. Value Object
doesn‘t have a distinct identity
treated as immutable
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
59. Aggregate
a cluster of associated objects
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
60. Aggregate
treated as a unit
for the purpose of data changes
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
61. Aggregate
a set of consistency rules applies
within the aggregate‘s boundaries
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
62. Aggregate
enforces its own invariants and
is always in a valid state
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
63. AGENDA
The Blue Book An Example Tactical Patterns
Actually it should Bounded Contexts A short review of
be two books! and Subdomains the Building Blocks
1 2 3 4 5 6
Terminology Lasagna End
of Strategic Design … the new Spaghetti Questions & Answers
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
64. To summarize: DDD is basically the application
of the SOLID principles of object-orientation
on an architectural level
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
65. ?
QUESTIONS
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
66. THANK YOU!
follow me: @dtraub
Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de