challenges of modern software developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf ·...
TRANSCRIPT
![Page 1: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/1.jpg)
DDD
Where’s the value and what’s
in it for me?
Dino Esposito
JetBrains
@despos
facebook.com/naa4e
![Page 2: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/2.jpg)
What does a software
architect do?
![Page 3: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/3.jpg)
Design software driven bythe requirements of users
the characteristics of the business domain
the time we have
the money we’ve been told we’ll get
![Page 4: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/4.jpg)
Let’s talk user requirementsTend to focus on the vision each user has of the system
Tend to blink at technical solutions (usually trivial)
Tend to minimize the number of aspects/features to consider
Constantly incomplete, inaccurate and ambiguous
![Page 5: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/5.jpg)
Let’s talk business domainThere are no two identical business domains that are the same
A business domain is larger than the system we’re building
Take to abstract data and behaviour and generalize too much
Hard to fully comprehend unless you’re an expert already
![Page 6: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/6.jpg)
![Page 7: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/7.jpg)
We deliver software that works
but not in the way customers like
![Page 8: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/8.jpg)
BLACK
MAGIC
CAREFULLY
CRAFTED
DATA MODEL
SURE WE AREN’T SCREWING IT UP
ENTIRELY ?
![Page 9: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/9.jpg)
After decades of relational programming,
the current generation of architects grew
up with the obsession of data models.
![Page 10: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/10.jpg)
The obsession of data models brought to
creating object models where objects are
designed to contain data rather than to
expose some behavior.
![Page 11: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/11.jpg)
Hello!
I’m an object
Get/Set
my properties for free!
Hello!
I implement
some behavior
Pass data
and I’ll do the rest!
![Page 12: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/12.jpg)
DOMAIN DRIVEN DESIGN
is much more serious a thing than just
having an object-oriented model for a
bunch of business entities
![Page 13: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/13.jpg)
Domain Driven Design
Tackling complexity in the heart of software
RESULTS
Not actually cheating; not completely clear
Not hard to do right; easier to do wrong
An approach to software design and development
introduced 10+ years ago with the intent of …
![Page 14: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/14.jpg)
Common Understanding of DDD
Behavior is all that matters
Properties should be read-only
We got to use an O/RM
The database? It doesn’t
matter
![Page 15: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/15.jpg)
All of your classes
in a domain model
should have a
factory …
Domain model is NOT simply a fancy object model.
Domain model is NOT the starting point of DDD.
Domain model is ONE of the possible ending points.
![Page 16: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/16.jpg)
DDD Strategic Design
Ubiquitous Language
Bounded Context
Context Map
![Page 17: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/17.jpg)
SHARED VOCABULARY of TERMS
Dev
teams
Domain
experts
Mapping to
technical
actions (e.g., cache,
security, database)
Referring
to key
business
concepts
![Page 18: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/18.jpg)
Dynamically Changing Grammar
Vocabulary of valid words (nouns and verbs)
Formal grammar for generating valid
expressions out of valid words
Not all verbs can be used with all nouns
Accept an invoice is valid
Accept an order is not valid
![Page 19: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/19.jpg)
When in Rome … do as the Romans do
Cancel the booking
Checkout
Extend the job order
Register/Accept the invoice
Delete the booking
Submit the order
Update the job order
Create the invoice
Set state of the game Start/Pause the game
![Page 20: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/20.jpg)
Management
Saved to a wiki (or Excel/OneNote)Each term fully explained, understandable to both domain
and software experts
Kept it up-to-date (not a static thing) Evolve as new insights are gained about the domain
Responsibility of the development team
![Page 21: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/21.jpg)
Ubiquitous ≈ Used Everywhere
User Stories & RFC
Meetings
Emails
Technical Documentation
Schedule
Source codeSource code
![Page 22: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/22.jpg)
Not a freaky new name for
naming conventions.
![Page 23: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/23.jpg)
Use the model as the backbone
of a language.—Eric Evans
Use the language as the backbone of a model.
![Page 24: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/24.jpg)
Acronyms
Human
language of
words
![Page 25: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/25.jpg)
Bounded ContextBounded Context
Domain Domain Model
Problem Space Solution Space
SubdomainSubdomain
![Page 26: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/26.jpg)
Splitting a Domain in Contexts
BUSINESS DOMAIN
![Page 27: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/27.jpg)
Bounded Context
Ubiquitous language
Independent implementation
External interface(to other contexts)
![Page 28: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/28.jpg)
You find a bounded context
when the ubiquitous language change.
![Page 29: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/29.jpg)
When the language changes …
A word is discovered to have different meanings or
different representations
“Customer” means X to user 1 and Y to user 2
Different users use different words for the same concept
User 1 refers to customers as “users”. User 2 refers to
customers as “members”
Different users use different “algorithms” for the same
task and introduce different entities
User 1 knows about check-in. User 2 doesn’t use any similar
concept in the same business domain
![Page 30: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/30.jpg)
Concrete examples of a bounded context
Legacy system
External system
Critical system to
better treat separately
![Page 31: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/31.jpg)
Frontend
Shopping cart
Processing logic
Accounting
Backoffice
Business rules
(discounts, configuration,
personalization)
Shipping
External
system
Persistence
Payment
External
system
![Page 32: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/32.jpg)
FRONTEND
SHOPPING CART
Application logic
BACKOFFICE
ACCOUNTING
PAYMENT SHIPPING
BIZ RULES
PERSISTENCE
SHIPPING
gateway
PAYMENT
gateway
d
u
u
d
u
u
dd
partner
supplier
supplier
conformist
supplier
![Page 33: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/33.jpg)
Relationships
• Downstream context depends on upstream context
• No negotiation possibleConformist
• Customer context depends on supplier context
• Chance to raise concerns and have them addressed in some way
Customer/Supplier
• Mutual dependency between the two contexts Partner
• Shared model that can’t be changed without consulting teams in charge of contexts that depend on it. Shared Kernel
• Additional layer giving the downstream context a fixed interface no matter what happens in the upstream contextAnti-corruption Layer
![Page 34: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/34.jpg)
UX-driven Design in 3 steps
![Page 35: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/35.jpg)
PRESENTATION
collection of screens
REST OF THE SYSTEM
INPUT MODEL
VIEW MODEL
![Page 36: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/36.jpg)
PRESENTATION
collection of screens
APPLICATION LAYER
endpoints invoked from controllers
INPUT MODEL
VIEW MODEL
REST OF THE SYSTEM
ASP.NET
MVC
CONTROLLERS
RAZOR views
Application Services
Tasks | Workflows
WHATEVER YOU HAVE
![Page 37: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/37.jpg)
ASP.NET
MVC
CONTROLLERS
RAZOR views
Application Services
Tasks | Workflows
WHATEVER YOU HAVE
SINGLE-TIER
ASP.NET MVC or
ASP.NET CORE
SINGLE-TIER
ASP.NET MVC or
ASP.NET CORE
SINGLE-TIER
ASP.NET MVC or
ASP.NET CORE
SINGLE-TIER
ASP.NET MVC or
ASP.NET CORE
WHATEVER YOU
HAVE
![Page 38: Challenges of Modern Software Developmentsddconf.com/brands/sdd/library/sdd16_esposito_ddd.pdf · Tend to blink at technical solutions (usually trivial) Tend to minimize the number](https://reader035.vdocuments.us/reader035/viewer/2022081404/5f05518f7e708231d4125f31/html5/thumbnails/38.jpg)
http://naa4e.codeplex.com
http://www.pluralsight.com/courses/
modern-software-architecture-
domain-models-cqrs-event-
sourcing
Modern Software Architecture