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

Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson AEM HUB
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...Nithin Kumar,VVCE, Mysuru
 
The lazy programmer's guide to writing thousands of tests
The lazy programmer's guide to writing thousands of testsThe lazy programmer's guide to writing thousands of tests
The lazy programmer's guide to writing thousands of testsScott Wlaschin
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfKnoldus Inc.
 
Introduction to Java 11
Introduction to Java 11 Introduction to Java 11
Introduction to Java 11 Knoldus Inc.
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Sunghyouk Bae
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooksMaulik Shah
 
Integração de Sistemas utilizando Apache Camel
Integração de Sistemas utilizando Apache CamelIntegração de Sistemas utilizando Apache Camel
Integração de Sistemas utilizando Apache CamelPedro Oliveira
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSKnoldus Inc.
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITnamespaceit
 

What's hot (20)

Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Java 8 date & time api
Java 8 date & time apiJava 8 date & time api
Java 8 date & time api
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
 
The lazy programmer's guide to writing thousands of tests
The lazy programmer's guide to writing thousands of testsThe lazy programmer's guide to writing thousands of tests
The lazy programmer's guide to writing thousands of tests
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
Clean code
Clean codeClean code
Clean code
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
Java 11 to 17 : What's new !?
Java 11 to 17 : What's new !?Java 11 to 17 : What's new !?
Java 11 to 17 : What's new !?
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdf
 
Clean code
Clean code Clean code
Clean code
 
Introduction to Java 11
Introduction to Java 11 Introduction to Java 11
Introduction to Java 11
 
Core java
Core javaCore java
Core java
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
Integração de Sistemas utilizando Apache Camel
Integração de Sistemas utilizando Apache CamelIntegração de Sistemas utilizando Apache Camel
Integração de Sistemas utilizando Apache Camel
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
React hooks
React hooksReact hooks
React hooks
 

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 (7)

DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 
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

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

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