SlideShare a Scribd company logo
1 of 74
Download to read offline
Domain
Driven Design
What is
Domain Driven
Design
Domain Driven Design is an idea,
first coined by Eric Evans in his
book “Domain Driven Design-
Tackling Complexity in the
Heart of Software” at 2004.
DDD suggests a set of tools and
best practices for developing
software that deliver highest
value.
2
Design
Good or Bad or Effective Design
3
Bad Design
Situations when we use Bad design
◦ Pressure on Delivering the Software
◦ Trying to Save Economywith No Design
Results of Bad Design-
◦ Priorityon Database Design over Business Process and
operations
◦ Trying to Solve Business Problemsusing Shiny
Technologies
◦ Meaningless naming of Objects and Operations
◦ Appoint the Business logics in UI or in Database
4
◦ Meet the business Needs
◦ Helps to Identify the core business
◦ Guide to Create a Correct Software Model
Good &
Effective
Design
5
Effective
Design
in DDD
Domain Driven Design offers two types of design tools
for design and develop effective software-
 Strategic Design
 Tactical Design
6
Strategic
Design
8
Set of Principles thatallows us to
 Segregate domainmodel using Bounded Context
 Develop the Language for Domain Model within the
Bounded Context
 Segregate the Domain into different sub domains
 Mapping between different Bounded Contexts
“
9
Context
◦ Circumstances of an event or
idea or statement
◦ Same thing can behave or act
differently in different context
◦ Context is so important
.
10
Why Context Matters
11
◦ Any Context that has a defined Boundary
◦ All component of a context
◦ Has specific meaning
◦ Do specific thing
Bounded
Context
12
Ubiquitous
Language
13
Ubiquitous
Language
Agile Manifesto says-
Customer collaboration over Contract Negotiation
Collaboration with Customer (Doman Experts)is given the
highest priorityin Domain Driven Design. During
Collaboration team builds a Language which is known as
UbiquitousLanguage.
This language is all about business domain and business
terminology. No technical termswill be uses here.
The UbiquitousLanguagewill reflect the core business
domain and our domain model will be the
implementation of this Language.
EntireTeam will communicateeach other by using this
languageso that everyone properlyunderstand what is
being happening.
14
Sub
Domain
15
A Sub Domain is the part of the overall business domain.
Most business domains are usually too large and complex.
So we logically break down it and divided into different
sub domains based on their responsibilities.
By using Sub Domain we can easily understand our
problem space on a large, complex project.
There are three types of Subdomain-
Core Domain, Generic Subdomain, Supporting Subdomain
Context
Mapping
16
During designing and developing softwareusing Domain
Driven Design we often need to use multiplebounded
context. These contextsalso need to communicatewith
each other. So Context mapping came to the picture.
By using context mapping we relate one bounded context
with another. Or we can also thinklike by using context
mapping our different sub domains are relate with our
core domain.
Types of
Mapping
17
Based on communicationnature there are differenttypes of
mappingare suggests by DDD.
Continuous
Integration
Problem of working multiple members
◦ Breaking down the system into ever-smaller contexts so loses a
valuable level of integration and coherency
Solution
◦ Merging all code and other implementation artifacts frequently
◦ Run Integration Tests to ensure Merging Succeeded.
Continuous Integration Tools
◦ Team City
◦ Jenkins
18
Tactical
Design
19
1 2 3
20
Model
Driven
Design
Design of the software that will
implemented by using the
domain model is called the Model
Driven Design.
21
 An Object
 Doesn’t have any Identity
 Uses as the value of a particular entity
 Immutable
 Reduces complexity & forces Ubiquitous
Language
Value Object
22
Commonly used Value object in C#/Java
String is a value object. It is actually a char
Array. String wraps the char array and gives us
so much business functionalities like
Substring(), Replace(), Trim() etc. If we use char
array for handling all those functionalities then
it would be nightmare for us.
Value Object
23
Example of Value Object:
We can use Money of type float in our entity.
But instead if we create a value object called
Money and handle all validation and domain
logic inside the value object.
Finally call the Money inside entity for defining
the Money property it will make our entity
more ubiquitous as money is of type Money
and make our code more cleaner.
Value Object
24
Code Example
Value Object
25
 An object
 Can uniquely identified by using Id
 Can Consists Value Object
 Mutable
 Can contain validations and domain logics
 Persisted as a row in Database
Entity
26
Code Example
Entity
27
Aggregate
28
 Collection of Entities and Value Objects which has a
single transactionalboundary
 Ensure the transactional consistency of our domain
entities
Aggregate
29
Example
 We have an Aggregate with three entities Order, Order Info
and Order Items something like follows-
 An Order can have one or more Order Items.
 If any of the Order Items changes then we might need to
change the status of the Order.
 So all of them have strict transaction boundary and they
are consistent all the time
Aggregate
Root
30
All entities and value objects of an Aggregate has a root entity
called the Aggregate Root.
Example:
In Order Aggregate Order is the Root Entity i.e. Aggregate
Root.
Root entity governs the lifetime of all other entities of an
Aggregate
Example:
If we delete the order then relevant Order Items and Order Info
will also remove at the same time.
Domain
Event
31
DomainEventis an eventthatdefined insidethe modelof a
boundedContext.
Sometimeswhen any transactionoccursthen somechanges also
happeninto anotherpart of the domain.In that case we will use
the domainevent.
As soon as somethinghappeninsidethe domainmodelof a
boundedcontextat the same timesomethingalso will happen
inside the domain model ofanotherboundedcontextwhichis
needed.
Service
There are three types of services
in Domain Driven Design whose
are-
 Domain Services
 Application Services
 Infrastructure Services
32
Domain
Services
Act as Façade. Coordinator for
Caching and Transactions.
Example:
Catalog service for ecommerce
domain which deals with all the
catalog related transactions.
33
Application
Services
Application Services are the
services that used in application
level or by the outside world.
Example:
API or Controller are considered as
the Application Service
34
Infrastructure
Services
Communicates directly with
external resources
Example: SMTP
35
Store Aggregates into in-memory collection.
We can also get extracted whenever we are
needed.
Example: DbSet of Code First Entity Framework
Repository
36
Martin Fowler defined a Pattern for handling
repository in more abstract way
Repository
Pattern
37
Example
Factory
38
A Method for creating the instance of
Domain Model whenever needed.
Layred
Architecture
39
Onion Architecture
40
Case Study
Agile Product Management Tool for Scrum
41
 Core Conceptis a Product will develop
 Product has BacklogItems,Releases & Sprints
 Each BacklogItem has a number of Tasks
 Each Taskcan have collectionof Estimation Log Entries
 Release have ScheduledBacklog Items
 Sprints have Committed Backlog Item
42
Then the client increased their requirements.They also need-
 Subscribing optionforall subscriberOrganization
 User optionfor each subscriber
 Levelof Permissionsforeach user
 A Discussion panel as Collaboration tool
So our modelsize increased
43
Again client increased their requirements.Now they need-
 A Forum forCategorywise discussionlike ProductDiscussion,Release Discussion,Sprint
BacklogDiscussion etc.
 Calendar entry system for set the milestones
So again our modelsize increased-
44
Then they added more requirementfor
 Will have a option for make a Team
 Track the Time Consuming Resources ina Sprint
 Resource Manager for setting up Time and Availability of Team Members and ProductOwner
45
Aftera while as the requirements are increasing the modelwill become Big Ball of Mud as follows-
Big Ball of
Mud
46
A BIG BALL OF MUD is haphazardly structured,
sprawling, sloppy, Spaghetti Code jungle.
DDD Strategic Design
47
48
Collaborate Domain Expert and Team to Identifywhat is Core and build the Ubiquitous Language
49
Why Collaborationis so Important?
 Domain expert has the every business knowledge and it’s processes
 Developersonly know how to code,uses best frameworks,Database Tools etc.
So it order to gather business knowledge,Identify the core and build Ubiquitous language Collaboration
is so important
Identify the Core
Challenge & Unify
Challenge-01
Shall we add all concepts of large model to
Ubiquitous Language of Scrum?
51
Answer is No because-
Tenant, User and Permission has nothing to
do with Scrum. So they should be out of our
Scrum software model.
Challenge-02
52
Is there anything missing in Scrum model?
Three core concepts of Scrum i.e. Product
Owner, Team and Team Members are
missing here. So need to add with Scrum
model
Challenge-03
53
Are Support Plans and Payments really
goes with Scrum Project Management?
No. Both Support-Plans and Payments will
be managed under a Tenant’s Account, but
these are not part of our core Scrum
language.
Challenge-04
54
What about Human Resource concerns?
They will not directly used by Product owner
or Team Members. So they will be out of
Scrum Context.
Challenge-5
55
Would Milestones, Retrospectives, Reminders,
Plans etc. be in the core model of Scrum?
Calendar-based Milestones, Retrospectives, Reminders,
Plans etc. are in context. But the team would prefer to
save those modeling efforts for a later sprint. They are in
context, but for now they are out of scope.
56
Finally our Model is divided into multiple sub domains as
per their responsibilities
Developing
Ubiquitous Language
Tool for
Developing UL
58
During collaboration with Domain Expert-
 What are the Domain Model is supposed to do
 How the Domain Model Should Work
 What are the various components of the model
 What those components are do and how
How to build such Scenario?
Develop Concrete Scenarios that are specifically
focus around a domain model.
Tool for
Developing UL
59
The Answer will be “The Product Owner”. So
the Scenario will be refine as follows-
Now we have our Scenario.
Carefully brainstorm and refine the Scenario-
Ask Domain Expert-
“Who commit the backlog item to a sprint?”
Tool for
Developing UL
60
The Answer will be “No”.
It depends on the Teams agreement about
how much they will be able to complete
within a sprint duration.
Ask Domain Expert-
“Would the Product Owner be able to
Commit backlog item as much as want?”
Tool for
Developing UL
61
The Answer will be “Sprint”
So change and refine our UL again-
Ask Domain Expert-
Who are the interested parties?
Identifying the
Subdomain
Identify
Subdomains
63
Identify the sub Domains as per the
responsibilities of our Bounded Contexts
Aggregates
Aggregate
Rules of
Thumb
65
Protect Business Invariants
Each individual Aggregate will have
separate Transactional Boundary. So they
will Committed or Rolled back separately
Aggregate
Rules of
Thumb
66
Design Small Aggregate
Large Aggregate can causes
Transactional Failure.
Aggregate
Rules of
Thumb
67
Design Small Aggregate
Keep Aggregate as small as possible
Aggregate
Rules of
Thumb
68
Reference Other Aggregate by Id
To Save Memory Consumption Refer by Id
instead of entire Aggregate
Aggregate
Rules of
Thumb
69
Update Other Aggregate Eventually
Use Domain Events when needed to
update other Aggregate during updating a
Aggregate
Aggregate
Rules of
Thumb
70
Update Other Aggregate Eventually- Example
After committing the Backlog item to a Sprit
the Committing Sprint need to Notify. So we
will use Domain Event to notify the Sprint
Time to
Start Code
Further Reading
Thanks for your
Patience
Md. Mojammel Haque
CSM, CSPO, CSD, CSP (Scrum Alliance)
Software Architect, Raven Systems Ltd.
http://www.codermojam.com
codermojam@gmail.com
http://github.com/mojamcpds
https://www.linkedin.com/in/mojamhaque/
Cell- +8801795231350, 01817045882

More Related Content

What's hot

Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...
Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...
Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...mfrancis
 
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
 
DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDGregory Boissinot
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slidesthinkddd
 
Amazon AWS - a quick review
Amazon AWS - a quick reviewAmazon AWS - a quick review
Amazon AWS - a quick reviewGeeks Anonymes
 
Domain driven design: a gentle introduction
Domain driven design:  a gentle introductionDomain driven design:  a gentle introduction
Domain driven design: a gentle introductionAsher Sterkin
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignAndriy Buday
 
Domain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureDomain Driven Design and Hexagonal Architecture
Domain Driven Design and Hexagonal ArchitectureCrishantha Nanayakkara
 
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Agile India
 
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
 
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
 
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
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Eason Kuo
 

What's hot (18)

Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...
Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...
Modularity and Domain Driven Design - A killer combination - T De Wolf & S va...
 
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
 
DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDD
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slides
 
Amazon AWS - a quick review
Amazon AWS - a quick reviewAmazon AWS - a quick review
Amazon AWS - a quick review
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain driven design: a gentle introduction
Domain driven design:  a gentle introductionDomain driven design:  a gentle introduction
Domain driven design: a gentle introduction
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
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
 
SOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDDSOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDD
 
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Learn by doing
Learn by doingLearn by doing
Learn by doing
 
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
 
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)
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
 

Similar to 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 organizationAleix Morgadas
 
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
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignFrank Levering
 
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application growsCarolina Karklis
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignMuhammad Ali
 
From Legacy to DDD in PHP | Tech Talks | Privalia
From Legacy to DDD in PHP | Tech Talks | PrivaliaFrom Legacy to DDD in PHP | Tech Talks | Privalia
From Legacy to DDD in PHP | Tech Talks | PrivaliaJordi Vila Gallardo
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Refreshing Domain Driven Design
Refreshing Domain Driven DesignRefreshing Domain Driven Design
Refreshing Domain Driven DesignAndré Borgonovo
 
DDD - 1 - A gentle introduction to Domain Driven Design.pdf
DDD - 1 - A gentle introduction to Domain Driven Design.pdfDDD - 1 - A gentle introduction to Domain Driven Design.pdf
DDD - 1 - A gentle introduction to Domain Driven Design.pdfEleonora Ciceri
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 
Domain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachDomain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachPanagiotis Papaioannou
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSAndrea Saltarello
 
DITA and Localization: Bringing the Best Together
DITA and Localization: Bringing the Best TogetherDITA and Localization: Bringing the Best Together
DITA and Localization: Bringing the Best TogetherLavaCon
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven ArchitecturesLalit 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
 
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...OpenWhisk
 

Similar to Domain Driven Design (20)

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
 
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"
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application grows
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
From Legacy to DDD in PHP | Tech Talks | Privalia
From Legacy to DDD in PHP | Tech Talks | PrivaliaFrom Legacy to DDD in PHP | Tech Talks | Privalia
From Legacy to DDD in PHP | Tech Talks | Privalia
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 
Refreshing Domain Driven Design
Refreshing Domain Driven DesignRefreshing Domain Driven Design
Refreshing Domain Driven Design
 
DDD - 1 - A gentle introduction to Domain Driven Design.pdf
DDD - 1 - A gentle introduction to Domain Driven Design.pdfDDD - 1 - A gentle introduction to Domain Driven Design.pdf
DDD - 1 - A gentle introduction to Domain Driven Design.pdf
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 
SDWest2005Goetsch
SDWest2005GoetschSDWest2005Goetsch
SDWest2005Goetsch
 
Domain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachDomain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic Approach
 
Designingapplswithnet
DesigningapplswithnetDesigningapplswithnet
Designingapplswithnet
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRS
 
DITA and Localization: Bringing the Best Together
DITA and Localization: Bringing the Best TogetherDITA and Localization: Bringing the Best Together
DITA and Localization: Bringing the Best Together
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven Architectures
 
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
 
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
 
IBM Bluemix Openwhisk
IBM Bluemix OpenwhiskIBM Bluemix Openwhisk
IBM Bluemix Openwhisk
 

More from Mojammel Haque

Agile Estimating and Planning
Agile Estimating and PlanningAgile Estimating and Planning
Agile Estimating and PlanningMojammel Haque
 
Agile Estimating And Planning
Agile Estimating And PlanningAgile Estimating And Planning
Agile Estimating And PlanningMojammel Haque
 
Commonly used design patterns
Commonly used design patternsCommonly used design patterns
Commonly used design patternsMojammel Haque
 
Real Time App with SignalR
Real Time App with SignalRReal Time App with SignalR
Real Time App with SignalRMojammel Haque
 
Real time app with SignalR
Real time app with SignalR Real time app with SignalR
Real time app with SignalR Mojammel Haque
 

More from Mojammel Haque (6)

Introduction to scrum
Introduction to scrumIntroduction to scrum
Introduction to scrum
 
Agile Estimating and Planning
Agile Estimating and PlanningAgile Estimating and Planning
Agile Estimating and Planning
 
Agile Estimating And Planning
Agile Estimating And PlanningAgile Estimating And Planning
Agile Estimating And Planning
 
Commonly used design patterns
Commonly used design patternsCommonly used design patterns
Commonly used design patterns
 
Real Time App with SignalR
Real Time App with SignalRReal Time App with SignalR
Real Time App with SignalR
 
Real time app with SignalR
Real time app with SignalR Real time app with SignalR
Real time app with SignalR
 

Recently uploaded

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
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
 
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
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
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
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 

Domain Driven Design

  • 2. What is Domain Driven Design Domain Driven Design is an idea, first coined by Eric Evans in his book “Domain Driven Design- Tackling Complexity in the Heart of Software” at 2004. DDD suggests a set of tools and best practices for developing software that deliver highest value. 2
  • 3. Design Good or Bad or Effective Design 3
  • 4. Bad Design Situations when we use Bad design ◦ Pressure on Delivering the Software ◦ Trying to Save Economywith No Design Results of Bad Design- ◦ Priorityon Database Design over Business Process and operations ◦ Trying to Solve Business Problemsusing Shiny Technologies ◦ Meaningless naming of Objects and Operations ◦ Appoint the Business logics in UI or in Database 4
  • 5. ◦ Meet the business Needs ◦ Helps to Identify the core business ◦ Guide to Create a Correct Software Model Good & Effective Design 5
  • 6. Effective Design in DDD Domain Driven Design offers two types of design tools for design and develop effective software-  Strategic Design  Tactical Design 6
  • 7.
  • 8. Strategic Design 8 Set of Principles thatallows us to  Segregate domainmodel using Bounded Context  Develop the Language for Domain Model within the Bounded Context  Segregate the Domain into different sub domains  Mapping between different Bounded Contexts
  • 10. Context ◦ Circumstances of an event or idea or statement ◦ Same thing can behave or act differently in different context ◦ Context is so important . 10
  • 12. ◦ Any Context that has a defined Boundary ◦ All component of a context ◦ Has specific meaning ◦ Do specific thing Bounded Context 12
  • 14. Ubiquitous Language Agile Manifesto says- Customer collaboration over Contract Negotiation Collaboration with Customer (Doman Experts)is given the highest priorityin Domain Driven Design. During Collaboration team builds a Language which is known as UbiquitousLanguage. This language is all about business domain and business terminology. No technical termswill be uses here. The UbiquitousLanguagewill reflect the core business domain and our domain model will be the implementation of this Language. EntireTeam will communicateeach other by using this languageso that everyone properlyunderstand what is being happening. 14
  • 15. Sub Domain 15 A Sub Domain is the part of the overall business domain. Most business domains are usually too large and complex. So we logically break down it and divided into different sub domains based on their responsibilities. By using Sub Domain we can easily understand our problem space on a large, complex project. There are three types of Subdomain- Core Domain, Generic Subdomain, Supporting Subdomain
  • 16. Context Mapping 16 During designing and developing softwareusing Domain Driven Design we often need to use multiplebounded context. These contextsalso need to communicatewith each other. So Context mapping came to the picture. By using context mapping we relate one bounded context with another. Or we can also thinklike by using context mapping our different sub domains are relate with our core domain.
  • 17. Types of Mapping 17 Based on communicationnature there are differenttypes of mappingare suggests by DDD.
  • 18. Continuous Integration Problem of working multiple members ◦ Breaking down the system into ever-smaller contexts so loses a valuable level of integration and coherency Solution ◦ Merging all code and other implementation artifacts frequently ◦ Run Integration Tests to ensure Merging Succeeded. Continuous Integration Tools ◦ Team City ◦ Jenkins 18
  • 20. 20
  • 21. Model Driven Design Design of the software that will implemented by using the domain model is called the Model Driven Design. 21
  • 22.  An Object  Doesn’t have any Identity  Uses as the value of a particular entity  Immutable  Reduces complexity & forces Ubiquitous Language Value Object 22
  • 23. Commonly used Value object in C#/Java String is a value object. It is actually a char Array. String wraps the char array and gives us so much business functionalities like Substring(), Replace(), Trim() etc. If we use char array for handling all those functionalities then it would be nightmare for us. Value Object 23
  • 24. Example of Value Object: We can use Money of type float in our entity. But instead if we create a value object called Money and handle all validation and domain logic inside the value object. Finally call the Money inside entity for defining the Money property it will make our entity more ubiquitous as money is of type Money and make our code more cleaner. Value Object 24
  • 26.  An object  Can uniquely identified by using Id  Can Consists Value Object  Mutable  Can contain validations and domain logics  Persisted as a row in Database Entity 26
  • 28. Aggregate 28  Collection of Entities and Value Objects which has a single transactionalboundary  Ensure the transactional consistency of our domain entities
  • 29. Aggregate 29 Example  We have an Aggregate with three entities Order, Order Info and Order Items something like follows-  An Order can have one or more Order Items.  If any of the Order Items changes then we might need to change the status of the Order.  So all of them have strict transaction boundary and they are consistent all the time
  • 30. Aggregate Root 30 All entities and value objects of an Aggregate has a root entity called the Aggregate Root. Example: In Order Aggregate Order is the Root Entity i.e. Aggregate Root. Root entity governs the lifetime of all other entities of an Aggregate Example: If we delete the order then relevant Order Items and Order Info will also remove at the same time.
  • 31. Domain Event 31 DomainEventis an eventthatdefined insidethe modelof a boundedContext. Sometimeswhen any transactionoccursthen somechanges also happeninto anotherpart of the domain.In that case we will use the domainevent. As soon as somethinghappeninsidethe domainmodelof a boundedcontextat the same timesomethingalso will happen inside the domain model ofanotherboundedcontextwhichis needed.
  • 32. Service There are three types of services in Domain Driven Design whose are-  Domain Services  Application Services  Infrastructure Services 32
  • 33. Domain Services Act as Façade. Coordinator for Caching and Transactions. Example: Catalog service for ecommerce domain which deals with all the catalog related transactions. 33
  • 34. Application Services Application Services are the services that used in application level or by the outside world. Example: API or Controller are considered as the Application Service 34
  • 36. Store Aggregates into in-memory collection. We can also get extracted whenever we are needed. Example: DbSet of Code First Entity Framework Repository 36
  • 37. Martin Fowler defined a Pattern for handling repository in more abstract way Repository Pattern 37 Example
  • 38. Factory 38 A Method for creating the instance of Domain Model whenever needed.
  • 40. 40 Case Study Agile Product Management Tool for Scrum
  • 41. 41  Core Conceptis a Product will develop  Product has BacklogItems,Releases & Sprints  Each BacklogItem has a number of Tasks  Each Taskcan have collectionof Estimation Log Entries  Release have ScheduledBacklog Items  Sprints have Committed Backlog Item
  • 42. 42 Then the client increased their requirements.They also need-  Subscribing optionforall subscriberOrganization  User optionfor each subscriber  Levelof Permissionsforeach user  A Discussion panel as Collaboration tool So our modelsize increased
  • 43. 43 Again client increased their requirements.Now they need-  A Forum forCategorywise discussionlike ProductDiscussion,Release Discussion,Sprint BacklogDiscussion etc.  Calendar entry system for set the milestones So again our modelsize increased-
  • 44. 44 Then they added more requirementfor  Will have a option for make a Team  Track the Time Consuming Resources ina Sprint  Resource Manager for setting up Time and Availability of Team Members and ProductOwner
  • 45. 45 Aftera while as the requirements are increasing the modelwill become Big Ball of Mud as follows-
  • 46. Big Ball of Mud 46 A BIG BALL OF MUD is haphazardly structured, sprawling, sloppy, Spaghetti Code jungle.
  • 48. 48 Collaborate Domain Expert and Team to Identifywhat is Core and build the Ubiquitous Language
  • 49. 49 Why Collaborationis so Important?  Domain expert has the every business knowledge and it’s processes  Developersonly know how to code,uses best frameworks,Database Tools etc. So it order to gather business knowledge,Identify the core and build Ubiquitous language Collaboration is so important
  • 51. Challenge-01 Shall we add all concepts of large model to Ubiquitous Language of Scrum? 51 Answer is No because- Tenant, User and Permission has nothing to do with Scrum. So they should be out of our Scrum software model.
  • 52. Challenge-02 52 Is there anything missing in Scrum model? Three core concepts of Scrum i.e. Product Owner, Team and Team Members are missing here. So need to add with Scrum model
  • 53. Challenge-03 53 Are Support Plans and Payments really goes with Scrum Project Management? No. Both Support-Plans and Payments will be managed under a Tenant’s Account, but these are not part of our core Scrum language.
  • 54. Challenge-04 54 What about Human Resource concerns? They will not directly used by Product owner or Team Members. So they will be out of Scrum Context.
  • 55. Challenge-5 55 Would Milestones, Retrospectives, Reminders, Plans etc. be in the core model of Scrum? Calendar-based Milestones, Retrospectives, Reminders, Plans etc. are in context. But the team would prefer to save those modeling efforts for a later sprint. They are in context, but for now they are out of scope.
  • 56. 56 Finally our Model is divided into multiple sub domains as per their responsibilities
  • 58. Tool for Developing UL 58 During collaboration with Domain Expert-  What are the Domain Model is supposed to do  How the Domain Model Should Work  What are the various components of the model  What those components are do and how How to build such Scenario? Develop Concrete Scenarios that are specifically focus around a domain model.
  • 59. Tool for Developing UL 59 The Answer will be “The Product Owner”. So the Scenario will be refine as follows- Now we have our Scenario. Carefully brainstorm and refine the Scenario- Ask Domain Expert- “Who commit the backlog item to a sprint?”
  • 60. Tool for Developing UL 60 The Answer will be “No”. It depends on the Teams agreement about how much they will be able to complete within a sprint duration. Ask Domain Expert- “Would the Product Owner be able to Commit backlog item as much as want?”
  • 61. Tool for Developing UL 61 The Answer will be “Sprint” So change and refine our UL again- Ask Domain Expert- Who are the interested parties?
  • 63. Identify Subdomains 63 Identify the sub Domains as per the responsibilities of our Bounded Contexts
  • 65. Aggregate Rules of Thumb 65 Protect Business Invariants Each individual Aggregate will have separate Transactional Boundary. So they will Committed or Rolled back separately
  • 66. Aggregate Rules of Thumb 66 Design Small Aggregate Large Aggregate can causes Transactional Failure.
  • 67. Aggregate Rules of Thumb 67 Design Small Aggregate Keep Aggregate as small as possible
  • 68. Aggregate Rules of Thumb 68 Reference Other Aggregate by Id To Save Memory Consumption Refer by Id instead of entire Aggregate
  • 69. Aggregate Rules of Thumb 69 Update Other Aggregate Eventually Use Domain Events when needed to update other Aggregate during updating a Aggregate
  • 70. Aggregate Rules of Thumb 70 Update Other Aggregate Eventually- Example After committing the Backlog item to a Sprit the Committing Sprint need to Notify. So we will use Domain Event to notify the Sprint
  • 74. Md. Mojammel Haque CSM, CSPO, CSD, CSP (Scrum Alliance) Software Architect, Raven Systems Ltd. http://www.codermojam.com codermojam@gmail.com http://github.com/mojamcpds https://www.linkedin.com/in/mojamhaque/ Cell- +8801795231350, 01817045882