SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Domain Driven Design
Tom Kocjan
I3Logix Inc.
What is DDD?
• It is a way of thinking and a set of priorities,
aimed at accelerating software projects that
have to deal with complicated domains.
• A Model driven software design approach
used to tackle the complexity of software
projects.
• Collection of principles and patterns that help
developers craft elegant systems.
Domain A sphere of knowledge or activity.
What an organization does and the world it does
it in.
Model A system of abstractions that describes
selected aspects of a domain and ignores
extraneous detail. Explains a complex domain in
a simple way.
A model is a distilled form of domain
knowledge, assumptions, rules and choices.
Definitions
DDD is a
Set of Driving Principles
• Speak a Ubiquitous Language within an
explicitly Bounded Context.
• Explore models in a creative collaboration of
domain practitioners and software
practitioners.
• Focus on the Core Domain.
• Model and implementation are bound...
developers are also responsible for the model.
Ubiquitous Language A language structured
around the domain model and used by all
team members to connect all the activities of
the team with the software.
Use it consistently in speech, documentation,
diagrams and code.
A Change in Ubiquitous Language <=> Change in
Model and Code.
Ubiquitous Language
The model we want…
• Helps us solve specific problems in our
domain.
• Is not necessarily “realistic”.
• Forms the basis of a language.
• Should remain current.
London Tube Map
Expressing the Model
• The model can be expressed through class
diagrams, explanatory diagrams, sequence
diagrams or whatever conveys the model.
• But, the design document is not the model!
The design document's purpose is to help
communicate and explain the model.
• The model is ultimately expressed in the code.
DDD is Agile and Iterative
The problem with Big Design Up Front:
• Models are distilled knowledge.
• At the beginning of a project, the team is as
ignorant as it will ever be.
• Up Front Analysis Locks in Ignorance!
Big Design Up FrontBig Design Up Front
The DDD ProcessThe DDD Process
One Team, One Language, One ModelOne Team, One Language, One Model
A Complex DomainA Complex DomainA Complex DomainA Complex Domain
Bounded Context An operational definition of
where a particular model is well-defined and
applicable. (Typically a subsystem, or the work
owned by a particular team).
Subdomain Part of the domain, based on a
particular conceptual decomposition of the
domain.
Breaking Down a Complex Domain
The Problem Space
The Solution Space
Layered Architecture
User Interface Responsible for presenting information to the
user and interpreting user commands.
Application This is a thin layer which coordinates the
application activity. It does not contain business logic. It does
not hold the state of the business objects.
Domain This layer contains information about the domain. This
is the heart of the business software. The state of business
objects is held here. Persistence details delegated to the
Infrastructure layer.
Infrastructure This layer acts as a supporting library for all the
other Layers. It provides communication between layers,
implements persistence for business objects, contains
supporting libraries for the user interface layer, etc.
Layers
Model Expressed in Software
• Entities
• Value Objects
• Aggregates
• Services
• Associations
• Factories
• Repositories
• Modules
• Context Mapping
Entities
• Objects which have an identity which remains
the same throughout the states of the
software.
• Must be distinguished from other similar
objects having the same attributes. (e.g. Bank
Account for Jim Smith)
• Attributes of an entity can change. (Mutable)
• Entities should have behavior. (Business Logic)
• No persistence behavior!
Value Objects
• Value Objects are the “things” within your
model that have no uniqueness.
• They are only equal to another Value Object if
all their attributes match.
• Value Objects are interchangeable.
• Attributes of a Value Object cannot change,
they must be replaced. (Immutable)
• Examples: Money, Address (usually), DTO
Aggregates
• An Aggregate is a cluster of Entities and Value
objects. (Object Graph) Each aggregate is treated as
one single unit.
• Each Aggregate has one root entity know as the
Aggregate Root.
• The root identity is global, the identities of entities
inside are local.
• External objects may have references only to root.
• Internal objects cannot be changed outside the
Aggregate.
Aggregates
Associations
• Impose a traversal direction.
• Add a qualifier, reduce multiplicity.
• Eliminate non essential associations.
Application “if the banking application can convert and export
our transactions into a spreadsheet file... that export is an
APPLICATION SERVICE”
Domain “If a service were devised to make appropriate debits
and credits for a found transfer, that capability would be a
DOMAIN SERVICE”
Infrastructure “a bank might have an application that sends an
e-mail. The interface that encapsulates the email system is an
INFRASTRUCTURE SERVICE”
Services Reside in Multiple Layers
Domain Services
• A Domain Service is Business Logic in the
domain that are not a natural part of an Entity
or Value Object.
• Services usually manipulate multiple Entities
and Value Objects.
• Services are stateless!
• A service has to be offered as an interface that
is defined as a part of the model. Its
parameters and results should be domain
objects.
Factories
• An object whose responsibility is the creation
of other objects.
• Create and manage complex domain objects.
• Especially useful for creating aggregates.
Repositories
• A Repository encapsulates domain objects
persistence and retrieval.
• Clean separation and one-way dependency
between the domain and data mapping layers.
• May encapsulate different fetching strategies,
distributed caching, NoSQL, Web Service, etc.
• Acts as a collection except with more
elaborate querying capability.
• One Repository per Aggregate!
Modules
• Break up your domain to reduce complexity
• High cohesion within module, loose coupling
between modules.
• Becomes part of the ubiquitous language
• Helps with decoupling
• Aids in extensibility
Context Mapping
• Mapping the contact points and translations
between bounded contexts.
Patterns for Context Mapping
• Shared Kernel
• Customer/Supplier
• Conformist
• Anti-corruption Layer
• Separate Ways
Resources
These are not the same:
•
Subdomain – Decomposition of the domain.
•
Module – Decomposition of the model and
associated software.
•
Aggregate – Decomposition of the run-time
data.
•
Service – Decomposition of functionality.
•
Bounded Context – Linguistic boundary
marking the applicability of distinct models.
Command Query Responsibility Segregation (CQRS)
The data that a client needs from the model is screen
based and different than the domain model.
CQRS Implementation

Weitere ähnliche Inhalte

Was ist angesagt?

Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignAndriy Buday
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Alan Christensen
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignNaeem Sarfraz
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroFabrício Rissetto
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design QuicklyMariam Hakobyan
 
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
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
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
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-designArnaud Bouchez
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing ArchitecturesVictor Rentea
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Araf Karsh Hamid
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureAbdelghani Azri
 

Was ist angesagt? (20)

Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
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
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
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
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing Architectures
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 

Andere mochten auch

Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Domain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureDomain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureCrishantha Nanayakkara
 
Domain-driven design - eine Einführung
Domain-driven design - eine EinführungDomain-driven design - eine Einführung
Domain-driven design - eine Einführungdie.agilen GmbH
 
Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven DesignDavid Berliner
 
CQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzCQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzOPEN KNOWLEDGE GmbH
 

Andere mochten auch (7)

Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
Domain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureDomain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal Architecture
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain-driven design - eine Einführung
Domain-driven design - eine EinführungDomain-driven design - eine Einführung
Domain-driven design - eine Einführung
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven Design
 
CQRS, der etwas andere Architekturansatz
CQRS, der etwas andere ArchitekturansatzCQRS, der etwas andere Architekturansatz
CQRS, der etwas andere Architekturansatz
 

Ähnlich wie Domain Driven Design (DDD)

Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017Jonathan Wylliem
 
Introduction to Domain driven design
Introduction to Domain driven designIntroduction to Domain driven design
Introduction to Domain driven designMuhammad Ali
 
Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Mark Windholtz
 
Domain Driven Design - Building Blocks
Domain Driven Design - Building BlocksDomain Driven Design - Building Blocks
Domain Driven Design - Building BlocksMark Windholtz
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseKevin Mas Ruiz
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignMuhammad Ali
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSAndrea Saltarello
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsMark Windholtz
 
A Case for Outside-In Design
A Case for Outside-In DesignA Case for Outside-In Design
A Case for Outside-In DesignSandro Mancuso
 
Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)IT Arena
 
Unit IV Software Engineering
Unit IV Software EngineeringUnit IV Software Engineering
Unit IV Software EngineeringNandhini S
 
Introduction to Domain-Driven Design
Introduction to Domain-Driven DesignIntroduction to Domain-Driven Design
Introduction to Domain-Driven DesignR-P-Azevedo
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"GlobalLogic Ukraine
 

Ähnlich wie Domain Driven Design (DDD) (20)

Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
 
Introduction to Domain driven design
Introduction to Domain driven designIntroduction to Domain driven design
Introduction to Domain driven design
 
Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15Domain Driven Design - Distillation - Chapter 15
Domain Driven Design - Distillation - Chapter 15
 
Domain Driven Design - Building Blocks
Domain Driven Design - Building BlocksDomain Driven Design - Building Blocks
Domain Driven Design - Building Blocks
 
DOMAIN DRIVER DESIGN
DOMAIN DRIVER DESIGNDOMAIN DRIVER DESIGN
DOMAIN DRIVER DESIGN
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRS
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic PatternsDomain Driven Design Big Picture Strategic Patterns
Domain Driven Design Big Picture Strategic Patterns
 
Introduction
IntroductionIntroduction
Introduction
 
DDD eXchange
DDD eXchangeDDD eXchange
DDD eXchange
 
how_does_ddd_work
how_does_ddd_workhow_does_ddd_work
how_does_ddd_work
 
A Case for Outside-In Design
A Case for Outside-In DesignA Case for Outside-In Design
A Case for Outside-In Design
 
Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)
 
Software Design
Software DesignSoftware Design
Software Design
 
Unit IV Software Engineering
Unit IV Software EngineeringUnit IV Software Engineering
Unit IV Software Engineering
 
Introduction to Domain-Driven Design
Introduction to Domain-Driven DesignIntroduction to Domain-Driven Design
Introduction to Domain-Driven Design
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
 

Kürzlich hochgeladen

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 

Kürzlich hochgeladen (20)

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 

Domain Driven Design (DDD)

  • 1. Domain Driven Design Tom Kocjan I3Logix Inc.
  • 2. What is DDD? • It is a way of thinking and a set of priorities, aimed at accelerating software projects that have to deal with complicated domains. • A Model driven software design approach used to tackle the complexity of software projects. • Collection of principles and patterns that help developers craft elegant systems.
  • 3. Domain A sphere of knowledge or activity. What an organization does and the world it does it in. Model A system of abstractions that describes selected aspects of a domain and ignores extraneous detail. Explains a complex domain in a simple way. A model is a distilled form of domain knowledge, assumptions, rules and choices. Definitions
  • 4.
  • 5.
  • 6. DDD is a Set of Driving Principles • Speak a Ubiquitous Language within an explicitly Bounded Context. • Explore models in a creative collaboration of domain practitioners and software practitioners. • Focus on the Core Domain. • Model and implementation are bound... developers are also responsible for the model.
  • 7. Ubiquitous Language A language structured around the domain model and used by all team members to connect all the activities of the team with the software. Use it consistently in speech, documentation, diagrams and code. A Change in Ubiquitous Language <=> Change in Model and Code. Ubiquitous Language
  • 8. The model we want… • Helps us solve specific problems in our domain. • Is not necessarily “realistic”. • Forms the basis of a language. • Should remain current.
  • 10. Expressing the Model • The model can be expressed through class diagrams, explanatory diagrams, sequence diagrams or whatever conveys the model. • But, the design document is not the model! The design document's purpose is to help communicate and explain the model. • The model is ultimately expressed in the code.
  • 11. DDD is Agile and Iterative The problem with Big Design Up Front: • Models are distilled knowledge. • At the beginning of a project, the team is as ignorant as it will ever be. • Up Front Analysis Locks in Ignorance!
  • 12. Big Design Up FrontBig Design Up Front
  • 13. The DDD ProcessThe DDD Process
  • 14.
  • 15. One Team, One Language, One ModelOne Team, One Language, One Model
  • 16. A Complex DomainA Complex DomainA Complex DomainA Complex Domain
  • 17. Bounded Context An operational definition of where a particular model is well-defined and applicable. (Typically a subsystem, or the work owned by a particular team). Subdomain Part of the domain, based on a particular conceptual decomposition of the domain. Breaking Down a Complex Domain
  • 19.
  • 20.
  • 23. User Interface Responsible for presenting information to the user and interpreting user commands. Application This is a thin layer which coordinates the application activity. It does not contain business logic. It does not hold the state of the business objects. Domain This layer contains information about the domain. This is the heart of the business software. The state of business objects is held here. Persistence details delegated to the Infrastructure layer. Infrastructure This layer acts as a supporting library for all the other Layers. It provides communication between layers, implements persistence for business objects, contains supporting libraries for the user interface layer, etc. Layers
  • 24. Model Expressed in Software • Entities • Value Objects • Aggregates • Services • Associations • Factories • Repositories • Modules • Context Mapping
  • 25. Entities • Objects which have an identity which remains the same throughout the states of the software. • Must be distinguished from other similar objects having the same attributes. (e.g. Bank Account for Jim Smith) • Attributes of an entity can change. (Mutable) • Entities should have behavior. (Business Logic) • No persistence behavior!
  • 26. Value Objects • Value Objects are the “things” within your model that have no uniqueness. • They are only equal to another Value Object if all their attributes match. • Value Objects are interchangeable. • Attributes of a Value Object cannot change, they must be replaced. (Immutable) • Examples: Money, Address (usually), DTO
  • 27. Aggregates • An Aggregate is a cluster of Entities and Value objects. (Object Graph) Each aggregate is treated as one single unit. • Each Aggregate has one root entity know as the Aggregate Root. • The root identity is global, the identities of entities inside are local. • External objects may have references only to root. • Internal objects cannot be changed outside the Aggregate.
  • 29. Associations • Impose a traversal direction. • Add a qualifier, reduce multiplicity. • Eliminate non essential associations.
  • 30. Application “if the banking application can convert and export our transactions into a spreadsheet file... that export is an APPLICATION SERVICE” Domain “If a service were devised to make appropriate debits and credits for a found transfer, that capability would be a DOMAIN SERVICE” Infrastructure “a bank might have an application that sends an e-mail. The interface that encapsulates the email system is an INFRASTRUCTURE SERVICE” Services Reside in Multiple Layers
  • 31. Domain Services • A Domain Service is Business Logic in the domain that are not a natural part of an Entity or Value Object. • Services usually manipulate multiple Entities and Value Objects. • Services are stateless! • A service has to be offered as an interface that is defined as a part of the model. Its parameters and results should be domain objects.
  • 32. Factories • An object whose responsibility is the creation of other objects. • Create and manage complex domain objects. • Especially useful for creating aggregates.
  • 33. Repositories • A Repository encapsulates domain objects persistence and retrieval. • Clean separation and one-way dependency between the domain and data mapping layers. • May encapsulate different fetching strategies, distributed caching, NoSQL, Web Service, etc. • Acts as a collection except with more elaborate querying capability. • One Repository per Aggregate!
  • 34. Modules • Break up your domain to reduce complexity • High cohesion within module, loose coupling between modules. • Becomes part of the ubiquitous language • Helps with decoupling • Aids in extensibility
  • 35. Context Mapping • Mapping the contact points and translations between bounded contexts.
  • 36. Patterns for Context Mapping • Shared Kernel • Customer/Supplier • Conformist • Anti-corruption Layer • Separate Ways
  • 38. These are not the same: • Subdomain – Decomposition of the domain. • Module – Decomposition of the model and associated software. • Aggregate – Decomposition of the run-time data. • Service – Decomposition of functionality. • Bounded Context – Linguistic boundary marking the applicability of distinct models.
  • 39. Command Query Responsibility Segregation (CQRS)
  • 40. The data that a client needs from the model is screen based and different than the domain model.

Hinweis der Redaktion

  1. That is a pretty dense statement. Over the next few hours, we’ll try to define enough terms and explain enough of what we concretely do in order to unpack this statement.
  2. Pegue o modelo de domínio de uma aplicação de e-commerce. Há muitos componentes diferentes que formam o grande sistema global. Algumas peças podem ser encontrados em qualquer sistema de e-commerce, mas alguns vão ser exclusivo para sua empresa. Estas peças irão definir o software e serão as razões fundamentais que você está construindo em vez de comprar.