SlideShare a Scribd company logo
1 of 22
DOMAIN DRIVEN
DESIGN
Prepared for the 4th Software Engineering Colloquium
Lorraine Steyn and Paul Johnson
Domain Driven Design                        2




Home Truths
A design should be as simple as possible,
      but no simpler



Agile development is about collaboration
      and communication
Domain Driven Design                                         3




Agile, briefly
Agile practitioners can be design avoidant!
      Avoid documentation, no big upfront analysis


Scrum and Agile encourage rapid change
      Quicker route to the BOM
      No time for design?
      Small user stories lose the big picture
      Scrum is particularly Process focused, and does not
       prescribe the technical approach
Domain Driven Design                                          4




Agile – the good bits
Short iterations
      Deliver working software in 2 to 3 week “sprints”
Empower people
      Team ownership
      Team commitment to deliver
Structured Process through Scrum
      The ability to respond to change is Agile, through a
       highly structured approach
      New ways of working: Pair programming, test-driven
       development
Domain Driven Design                                          5




How does DDD Help?
   Communication improved by ubiquitous language
       Between team and client
       All the way through to the code


   Design thinking improved by applying standard patterns
       Leverage off the wisdom of others
       Double edged sword if a pattern is mis-identified


   Ensure design and reality match
       Model stories and scenarios using concrete examples
       Refactor, refactor…
Domain Driven Design                                       6




Ubiquitous Language
 Evolve the language, don’t define it upfront
      Client, customer, user, stakeholder, person,
       accountholder, payer ???
      Bounded context


 Bridge the IT/Domain expert divide
      Remove technical aspects (server, logger etc)
      No technical jargon (stored proc, XML etc)
      Clarify business terms and insist on consistent usage
      Make it natural
Domain Driven Design                                                     7




In practice…
Domain Expert                       Developer
The correct risk factor must be     We can do that quite easily if we
used when we calculate the          create another adjustment type
insurance premium.                  and modify the stored proc.

What is this stored proc you talk   Never mind, it’s kind of like a
about?                              spreadsheet macro.

So how will this work as an         Well, we already have adjustment
adjustment?                         types for loyalty and zero-claim
                                    discounts, so we can add risk
                                    factor as another type.

But loyalty and zero-claim are      Well, all those things are handled
benefits, not discounts!            as adjustments in the system.
                                    Trust me!
Domain Driven Design                                              8




Ubiquitous Language Rules
 Let the model do the talking
      Look at the model (sketch) and tell a story
      Look at the code and tell the same story


 Define structured stories
      As a … I want … So that …
      Identify user value (start by understanding their world)


 Define specific scenarios that model
   behaviour we can test
      Given (/and)… When … Then …
Domain Driven Design                                       9




Doing it right
Business Story
   As a new customer
   I want to know how much extra my insurance will cost if I
   use my private car for business purposes
   So that I can check if I am still within budget

Scenario 1
   Given the market value of my car is R100,000
   And the car is used for private purposes only
   And the risk factor is 0.15% for cars valued R100,000
   When the premium is calculated
   Then the premium should be R150
Domain Driven Design                                  10




The Neglected Verb
Nouns are easy

KRS client in the Shipping industry defined
actions (verbs) for a crew transfer form:

Complete          -    Filled in
Accepted
Confirmed         -    Planner processes transfer
Authorized
Accepted          -    Manager approves transfer
Confirmed
Authorized        -    Ship is notified of transfer
Domain Driven Design                                      11




Considering a Model
Design emerges…
       Communication tool
       Patterns appear as you build the model

IEEE: Software Engineering is the application of a
systematic, disciplined, quantifiable approach to
development…

Tools don’t matter: UML, BPM, any sketch can be a model


YAGNI / KISS
Domain Driven Design                                    12




The Core Model
Layered approach:
       Presentation / User Interface
       Application Layer (stateless, eg. Menu items)
       Domain / Business Logic
       Infrastructure / Persistence (DB)


Identify contexts
Identify interfaces
Look for behaviour
Look for value
Domain Driven Design                                       13




Entities and Value Objects
Entities
       Nouns
       Identity
       eg. Person, Sale, Stock, Vehicle

Value Objects
       We care about what an object has, not what it is
       Immutable
       Lightweight
       eg. Calendar, Price, Age, Vehicle Type
Domain Driven Design                    14




In practice…
Create a quote for a hotel booking:
       Check in date, check out date
       Number of rooms
Domain Driven Design   15



    Entity




Value Object
Domain Driven Design    16




Mapping Patterns
Shared Kernel
Customer / Supplier
Conformist
Separate Ways
Anti-corruption Layer
  Aggregates
  Factories
  Repositories
Domain Driven Design   17




Aggregates
Domain Driven Design                              18




Exploring the Domain
Domains are often complex
Most domains have subtleties
You need to dig deep

Your design should improve as you go
       You have to refactor as you go

What happens if you implement the design
that you first thought of?
       You lock in your ignorance – Eric Evans
Domain Driven Design                                       19




In practice…

Scenario 1
   Given the market value of my car is R100,000
   And the car is used for private purposes only
   And the risk factor is 0.15% for cars valued R100,000
   When the premium is calculated
   Then the premium should be R150
Domain Driven Design                                                            20




In practice…
@Test
class CalcuatePremiumForCars {
    private CarPremiumCalculator calculator = new CarPremiumCalculator;
    public void carUsedForPrivateUseOnly() {
           // Given the market value of my car is R100,000
           Money marketValue = new Money(100000);
           // and the car is used for private purposes only
           boolean isForPrivateUse = true;
           // and the risk factor is currently 0.15% for cars valued R100,000
           calculator.addRiskFactor(1000000, 0.15);
           // When the premium is calculated
           Money premium = calculator.calculate(marketValue,
isForPrivateUse);
           // Then the premium should be R150
           assertEquals(new Money(150), premium);
    }
Domain Driven Design                                      21




Lessons from KRS
DDD isn’t just for architects
We teach DDD to our interns
It results in better software
       Forces developers to think in layers
       Concrete scenarios get developers closer to the true
        business requirements quicker
       Scenarios become your tests
       Ubiquitous language breaks down barriers between
        users and developers
       Better software becomes a habit
Domain Driven Design   22




             Questions?


www.krs.co.za
( (021) 681 2900
Lorraine Steyn:  lor@krs.co.za
Paul Johnson:    paul.johnson@krs.co.za

More Related Content

What's hot

DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDGregory Boissinot
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAraf Karsh Hamid
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven developmentDmitry Geyzersky
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignNader Albert
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLCAbdul Karim
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)José Roberto Araújo
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesRadosław Maziarka
 
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22Hakan ERDOGAN
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK toolsHaribabu Nandyal Padmanaban
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationOğuzhan Soykan
 
Domain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledDomain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledNicola Costantino
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 

What's hot (20)

DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDD
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and Microservices
 
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22
Autopilot - Accept Non-Stop Payments - Webrazzi Fintech'22
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
Domain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledDomain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) Distilled
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 

Viewers also liked

Domain-driven design - tactical patterns
Domain-driven design - tactical patternsDomain-driven design - tactical patterns
Domain-driven design - tactical patternsTom Janssens
 
Sample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogSample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogALATechSource
 
Example requirements specification
Example requirements specificationExample requirements specification
Example requirements specificationindrisrozas
 
Software requirements specification
Software  requirements specificationSoftware  requirements specification
Software requirements specificationKrishnasai Gudavalli
 

Viewers also liked (6)

Scrum + bdd + ddd
Scrum + bdd + dddScrum + bdd + ddd
Scrum + bdd + ddd
 
Domain-driven design - tactical patterns
Domain-driven design - tactical patternsDomain-driven design - tactical patterns
Domain-driven design - tactical patterns
 
From legacy to DDD
From legacy to DDDFrom legacy to DDD
From legacy to DDD
 
Sample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogSample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library Blog
 
Example requirements specification
Example requirements specificationExample requirements specification
Example requirements specification
 
Software requirements specification
Software  requirements specificationSoftware  requirements specification
Software requirements specification
 

Similar to Domain Driven Design in an Agile World

Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
Adopting Domain-Driven Design in your organization
Adopting Domain-Driven Design in your organizationAdopting Domain-Driven Design in your organization
Adopting Domain-Driven Design in your organizationAleix Morgadas
 
Latest trends in information technology
Latest trends in information technologyLatest trends in information technology
Latest trends in information technologyEldos Kuriakose
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsAlexander van Trijffel
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignFrank Levering
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven ArchitecturesLalit Kale
 
Invincible React States with Domain Driven Design
Invincible React States with Domain Driven Design Invincible React States with Domain Driven Design
Invincible React States with Domain Driven Design Prateek
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for EnterprisesWade Wegner
 
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)siouxhotornot
 
Domain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal ArchitectureDomain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal ArchitectureCan Pekdemir
 
Arch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxArch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxSanjoy Kumar Roy
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGDSCNiT
 
Serverless projects at Myplanet
Serverless projects at MyplanetServerless projects at Myplanet
Serverless projects at MyplanetDaniel Zivkovic
 
ASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownAvisi B.V.
 

Similar to Domain Driven Design in an Agile World (20)

Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Adopting Domain-Driven Design in your organization
Adopting Domain-Driven Design in your organizationAdopting Domain-Driven Design in your organization
Adopting Domain-Driven Design in your organization
 
Latest trends in information technology
Latest trends in information technologyLatest trends in information technology
Latest trends in information technology
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain Models
 
Resume
ResumeResume
Resume
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
WPEngine Summit 2019
WPEngine Summit 2019WPEngine Summit 2019
WPEngine Summit 2019
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven Architectures
 
Invincible React States with Domain Driven Design
Invincible React States with Domain Driven Design Invincible React States with Domain Driven Design
Invincible React States with Domain Driven Design
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
Technical Debt.pptx
Technical Debt.pptxTechnical Debt.pptx
Technical Debt.pptx
 
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
 
Domain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal ArchitectureDomain Driven Design & Hexagonal Architecture
Domain Driven Design & Hexagonal Architecture
 
Arch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxArch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptx
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptx
 
Serverless projects at Myplanet
Serverless projects at MyplanetServerless projects at Myplanet
Serverless projects at Myplanet
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
ASAS 2014 - Simon Brown
ASAS 2014 - Simon BrownASAS 2014 - Simon Brown
ASAS 2014 - Simon Brown
 

More from Lorraine Steyn

Applying Systems Thinking to Teams and Software.pptx
Applying Systems Thinking to Teams and Software.pptxApplying Systems Thinking to Teams and Software.pptx
Applying Systems Thinking to Teams and Software.pptxLorraine Steyn
 
Applying Systems Thinking in Teams.pptx
Applying Systems Thinking in Teams.pptxApplying Systems Thinking in Teams.pptx
Applying Systems Thinking in Teams.pptxLorraine Steyn
 
Systems Thinking and the Art of Simplification
Systems Thinking and the Art of SimplificationSystems Thinking and the Art of Simplification
Systems Thinking and the Art of SimplificationLorraine Steyn
 
Homo naledi - highlights from the paper published on eLife
Homo naledi - highlights from the paper published on eLifeHomo naledi - highlights from the paper published on eLife
Homo naledi - highlights from the paper published on eLifeLorraine Steyn
 
Fighting Facebook (social media marketing)
Fighting Facebook (social media marketing)Fighting Facebook (social media marketing)
Fighting Facebook (social media marketing)Lorraine Steyn
 
Entrepreneurially Agile
Entrepreneurially AgileEntrepreneurially Agile
Entrepreneurially AgileLorraine Steyn
 

More from Lorraine Steyn (9)

Applying Systems Thinking to Teams and Software.pptx
Applying Systems Thinking to Teams and Software.pptxApplying Systems Thinking to Teams and Software.pptx
Applying Systems Thinking to Teams and Software.pptx
 
Applying Systems Thinking in Teams.pptx
Applying Systems Thinking in Teams.pptxApplying Systems Thinking in Teams.pptx
Applying Systems Thinking in Teams.pptx
 
Systems Thinking and the Art of Simplification
Systems Thinking and the Art of SimplificationSystems Thinking and the Art of Simplification
Systems Thinking and the Art of Simplification
 
DDD Introduction
DDD IntroductionDDD Introduction
DDD Introduction
 
Systems Thinking 2019
Systems Thinking 2019Systems Thinking 2019
Systems Thinking 2019
 
Pair Programming
Pair ProgrammingPair Programming
Pair Programming
 
Homo naledi - highlights from the paper published on eLife
Homo naledi - highlights from the paper published on eLifeHomo naledi - highlights from the paper published on eLife
Homo naledi - highlights from the paper published on eLife
 
Fighting Facebook (social media marketing)
Fighting Facebook (social media marketing)Fighting Facebook (social media marketing)
Fighting Facebook (social media marketing)
 
Entrepreneurially Agile
Entrepreneurially AgileEntrepreneurially Agile
Entrepreneurially Agile
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Domain Driven Design in an Agile World

  • 1. DOMAIN DRIVEN DESIGN Prepared for the 4th Software Engineering Colloquium Lorraine Steyn and Paul Johnson
  • 2. Domain Driven Design 2 Home Truths A design should be as simple as possible, but no simpler Agile development is about collaboration and communication
  • 3. Domain Driven Design 3 Agile, briefly Agile practitioners can be design avoidant!  Avoid documentation, no big upfront analysis Scrum and Agile encourage rapid change  Quicker route to the BOM  No time for design?  Small user stories lose the big picture  Scrum is particularly Process focused, and does not prescribe the technical approach
  • 4. Domain Driven Design 4 Agile – the good bits Short iterations  Deliver working software in 2 to 3 week “sprints” Empower people  Team ownership  Team commitment to deliver Structured Process through Scrum  The ability to respond to change is Agile, through a highly structured approach  New ways of working: Pair programming, test-driven development
  • 5. Domain Driven Design 5 How does DDD Help?  Communication improved by ubiquitous language  Between team and client  All the way through to the code  Design thinking improved by applying standard patterns  Leverage off the wisdom of others  Double edged sword if a pattern is mis-identified  Ensure design and reality match  Model stories and scenarios using concrete examples  Refactor, refactor…
  • 6. Domain Driven Design 6 Ubiquitous Language  Evolve the language, don’t define it upfront  Client, customer, user, stakeholder, person, accountholder, payer ???  Bounded context  Bridge the IT/Domain expert divide  Remove technical aspects (server, logger etc)  No technical jargon (stored proc, XML etc)  Clarify business terms and insist on consistent usage  Make it natural
  • 7. Domain Driven Design 7 In practice… Domain Expert Developer The correct risk factor must be We can do that quite easily if we used when we calculate the create another adjustment type insurance premium. and modify the stored proc. What is this stored proc you talk Never mind, it’s kind of like a about? spreadsheet macro. So how will this work as an Well, we already have adjustment adjustment? types for loyalty and zero-claim discounts, so we can add risk factor as another type. But loyalty and zero-claim are Well, all those things are handled benefits, not discounts! as adjustments in the system. Trust me!
  • 8. Domain Driven Design 8 Ubiquitous Language Rules  Let the model do the talking  Look at the model (sketch) and tell a story  Look at the code and tell the same story  Define structured stories  As a … I want … So that …  Identify user value (start by understanding their world)  Define specific scenarios that model behaviour we can test  Given (/and)… When … Then …
  • 9. Domain Driven Design 9 Doing it right Business Story As a new customer I want to know how much extra my insurance will cost if I use my private car for business purposes So that I can check if I am still within budget Scenario 1 Given the market value of my car is R100,000 And the car is used for private purposes only And the risk factor is 0.15% for cars valued R100,000 When the premium is calculated Then the premium should be R150
  • 10. Domain Driven Design 10 The Neglected Verb Nouns are easy KRS client in the Shipping industry defined actions (verbs) for a crew transfer form: Complete - Filled in Accepted Confirmed - Planner processes transfer Authorized Accepted - Manager approves transfer Confirmed Authorized - Ship is notified of transfer
  • 11. Domain Driven Design 11 Considering a Model Design emerges…  Communication tool  Patterns appear as you build the model IEEE: Software Engineering is the application of a systematic, disciplined, quantifiable approach to development… Tools don’t matter: UML, BPM, any sketch can be a model YAGNI / KISS
  • 12. Domain Driven Design 12 The Core Model Layered approach:  Presentation / User Interface  Application Layer (stateless, eg. Menu items)  Domain / Business Logic  Infrastructure / Persistence (DB) Identify contexts Identify interfaces Look for behaviour Look for value
  • 13. Domain Driven Design 13 Entities and Value Objects Entities  Nouns  Identity  eg. Person, Sale, Stock, Vehicle Value Objects  We care about what an object has, not what it is  Immutable  Lightweight  eg. Calendar, Price, Age, Vehicle Type
  • 14. Domain Driven Design 14 In practice… Create a quote for a hotel booking:  Check in date, check out date  Number of rooms
  • 15. Domain Driven Design 15 Entity Value Object
  • 16. Domain Driven Design 16 Mapping Patterns Shared Kernel Customer / Supplier Conformist Separate Ways Anti-corruption Layer Aggregates Factories Repositories
  • 17. Domain Driven Design 17 Aggregates
  • 18. Domain Driven Design 18 Exploring the Domain Domains are often complex Most domains have subtleties You need to dig deep Your design should improve as you go  You have to refactor as you go What happens if you implement the design that you first thought of?  You lock in your ignorance – Eric Evans
  • 19. Domain Driven Design 19 In practice… Scenario 1 Given the market value of my car is R100,000 And the car is used for private purposes only And the risk factor is 0.15% for cars valued R100,000 When the premium is calculated Then the premium should be R150
  • 20. Domain Driven Design 20 In practice… @Test class CalcuatePremiumForCars { private CarPremiumCalculator calculator = new CarPremiumCalculator; public void carUsedForPrivateUseOnly() { // Given the market value of my car is R100,000 Money marketValue = new Money(100000); // and the car is used for private purposes only boolean isForPrivateUse = true; // and the risk factor is currently 0.15% for cars valued R100,000 calculator.addRiskFactor(1000000, 0.15); // When the premium is calculated Money premium = calculator.calculate(marketValue, isForPrivateUse); // Then the premium should be R150 assertEquals(new Money(150), premium); }
  • 21. Domain Driven Design 21 Lessons from KRS DDD isn’t just for architects We teach DDD to our interns It results in better software  Forces developers to think in layers  Concrete scenarios get developers closer to the true business requirements quicker  Scenarios become your tests  Ubiquitous language breaks down barriers between users and developers  Better software becomes a habit
  • 22. Domain Driven Design 22 Questions? www.krs.co.za ( (021) 681 2900 Lorraine Steyn: lor@krs.co.za Paul Johnson: paul.johnson@krs.co.za