Context is everywhere. From our daily conversations to complex marketing campaigns, context is king. But in Software Development, are we suffering due to the lack of context? Sure we are. This presentation will give you a few highlights of why context is crucial to building software in the right way. The target audience of this presentation is engineers, managers, and product owners, looking for a DDD introduction.
11. Match
+ location (String)
+ when (DateTime)
+ nameTeamA (String)
+ nameTeamB (String)
+ currentScore (Score)
+ status (Status)
+ comments (List<Comment>)
+ score(…)
+ undo(…)
+ comment(…)
Score
+ teamA (Int)
+ teamB (Int)
+ asText(String)
Comment
+ by (String)
+ when (DateTime)
+ content (String)
Status (Enum)
+ Not started
+ Started
+ 2nd half Started
+ Finished
Football Live Ticker Model
13. Match
+ location (String)
+ when (DateTime)
+ nameTeamA (String)
+ nameTeamB (String)
+ currentScore (Score)
+ status (Status)
+ isGrandSlan? (boolean)
+ comments (List<Comment>)
+ score(…)
+ undo(…)
+ comment(…)
Score
+ teamA (Int)
+ teamB (Int)
+ Sets (List<Set>)
+ asText()
Comment
+ by (String)
+ when (DateTime)
+ content (String)
Status (Enum)
+ Not started
+ Started
+ 2nd half Started
+ Suspended
+ Finished
Set
+ gamesWonPlayerA (Int)
+ gamesWonPlayerB (Int)
+ games (List<Game)
Point (Enum)
+ zero
+ fifteen
+ thirty
+ forty
+ deuce
+ advantage
+ game
Game
+ pointsPlayerA (Point)
+ pointsPlayerB (Point)
+ next(…)
Football & Tennis Live Ticker
Tennis specifics
(and very
simplified for
pedagogical
reasons)
Tennis Only
Football Only
Common
Huge Switch!
Football Score
<> Tennis
Score
Nullables!
Because they
are used for
different
scenarios
21. Match
+ location (String)
+ when (DateTime)
+ nameTeamA (String)
+ nameTeamB (String)
+ currentScore (Score)
+ status (Status)
+ isGrandSlan? (boolean)
+ comments (List<Comment>)
+ scoreFootball(…)
+ scoreTennis(…)
+ scoreVolleyball(…)
+ comment(…)
Score
+ teamA (Int)
+ teamB (Int)
+ Sets (List<Set>)
+ asText()
Comment
+ by (String)
+ when (DateTime)
+ content (String)
Status (Enum)
+ Not started
+ Started
+ 2nd half Started
+ Suspended
+ Finished
Set
+ gamesWonPlayerA (Int)
+ gamesWonPlayerB (Int)
+ pointsTeamA (Int)
+ pointsTeamB (Int)
+ isTieBreak? (Boolean)
+ games (List<Game)
Point (Enum)
+ zero
+ fifteen
+ thirty
+ forty
+ deuce
+ advantage
+ game
Game
+ pointsPlayerA (Point)
+ pointsPlayerB (Point)
+ next(…)
Football & Tennis & Volleyball Live Ticker
Score Team?
Status
Management
Team?
Comment Team?
Match Team?
22. Live Ticker
Comment Team
Score Team
Match Team
Comment
Service
Match
Service
Score
Service
Status Management
Team
Status
Service
Conway’s Law in Practice!
24. Volley
Service
Comment
Service
Tennis
Service
Football
Service
Another approach - Teams oriented by context
"Volleyball has new rules!
We need to adjust”
"We fixed Volley, but we
introduced a bug for Tennis”
"We need to support 20
new sports”
Change
s
required
X
Basketball
Service
"Volley Service is down!"
Other sports not impacted
X
28. Teams oriented by context
Comment Team
Score Team
Volley Team
Match Team
Football Team
Comment
Service
Match
Service
Score
Service
Status Management
Team
Tennis Team
Status
Service
Changing the teams will
not immediately change
the software
31. • Architecture
• More insights for Distributed Architecture
• Loosely coupled and strongly cohesive
Microservices
• Team Topology
• Teams with more autonomy
• Less coordination effort
Benefits of Context in Software Development
32. Bounded Context = Language Boundary
Terms
Rules
Behaviour
Expected
Jargons
Facts and Events
Relationships
33. “In general, microservices should cleanly
align to bounded contexts. So, if our
service boundaries align to the bounded
contexts in our domain, and our
microservices represent those bounded
contexts, we are off to an excellent
start ensuring that our microservices are
loosely coupled and strongly cohesive”
Building Microservices: Designing Fine-
Grained Systems, page 33
Sam Newman
(@samnewman)
34. • Code
• Code Design becomes simpler
• Better naming and intention revealing
• Improves code testability
• Productivity
• Decrease cognitive load
• Less side-effects when changing things (Aka Bugs)
• Architecture
• Insights for Distributed Architecture
• Loosely coupled and strongly cohesive Microservices
• Team Topology
• Teams with more autonomy
• Less coordination effort
Benefits of Context in Software Development
37. “if our models were music, they
would have the unmistakable sound
of completeness, purity,
power, and possibly even elegance
and beauty”
Implementing Domain-Driven Design
Vaughn Vernon
(@VaughnVernon)
44. • Deep Dive your Subdomains and
Bounded Contexts
• Understand the relationship
types among your Bounded
Contexts
• Implement your new projects
using Context as the main driver
What’s next?
45. Domain-Driven Design:
Tackling Complexity in the Heart of Software
Eric J. Evans
Implementing Domain-Driven Design
Vaughn Vernon
Team Topologies: Organizing Business
and Technology Teams for Fast Flow
Matthew Skelton / Manuel Pais
Building Microservices:
Designing Fine-Grained Systems
Sam Newman