SlideShare ist ein Scribd-Unternehmen logo
1 von 105
Hi there 👋
@carolkarklis 🏄♀️🍺💃
Software Developer at Magnetis
Ruby e Elixir ❤️
Cats <3
Diversity and Inclusion 💖
Brazilian 🇧🇷
01
Big picture of
Domain Driven
Design (DDD)
schedule
02
Why practicing
DDD?
03
Starting with
DDD
04
Approaches for
each scenario
@carolkarklis
Motivation behind this
talk came from a tech
event
Photo by James Pond on Unsplash @carolkarklis
When is it the right time to pay
more attention in the code and
architecture?
What is the balance of software
development?
Go horse
Balance
Code balance Overengineering
🐴 💣
Goal of this talk
■ Understand big picture of DDD
■ Be able to identify the current situation of business
■ Know the best approach given the current situation
■ Inspire and encourage the vision of bringing business
value through code
@carolkarklis
Big Picture of DDD
DDD means Domain Driven Design
Business domain guides project
development
Domain is a group of things that
company does to solve a
problem
Domain is how the company do
their business
Ecommerce system
Ecommerce system
Domain
Ecommerce system
Domain
Ubiquitous language
Is one of the pillars of Domain Driven Design
What is NOT
■ Business language (jargons, terms, etc)
Photo by Hans-Peter Gauster on Unsplash
What is NOT
■ Business language (jargons, terms, etc)
■ Communication of domains experts
Photo by Hans-Peter Gauster on Unsplash
What is NOT
■ Business language (jargons, terms, etc)
■ Communication of domains experts
■ A way of naming things in the code
Photo by Hans-Peter Gauster on Unsplash
What is NOT
■ Business language (jargons, terms, etc)
■ Communication of domains experts
■ A way of naming things in the code
■ The way developers communicate about the system
Photo by Hans-Peter Gauster on Unsplash
What is NOT
■ Business language (jargons, terms, etc)
■ Communication of domains experts
■ A way of naming things in the code
■ The way developers communicate about the system
■ Communication about how the system should work
(speculative)
Photo by Hans-Peter Gauster on Unsplash
"The practice of building up a
common, rigorous language
between developers and users"
Eric Evans
Ubiquitous language
It is based on domain model and express how the system works in an
understandable way for everyone in the team
A language about a shared knowledge of domain
made by the team
Code that expresses what the
domain does
"When implementing DDD, is
expected that code design is
questioned"
Vaughn Vernon, from the book Implementing Domain-Driven Design
Why practicing DDD?
(or how to convince your team to
dedicate time in this practice)
Photo by Benjamin Behre on Unsplash
Decrease of
knowledge island
Photo by NeONBRAND on Unsplash
A precise and
understandable
definition of the
business being
developed
Photo by Sabine Peters on Unsplash
Code
maintenance gets
easier and less
expensive
Photo by Brad Barmore on Unsplash
Continuous
modeling of the
system
Photo by NESA by Makers on Unsplash
More efficient
development due
the use of
ubiquitous
language
I believe that everyone can
benefit from practicing DDD
But the investment in DDD will
depend on company moment
Investments takes
time
The definition of investment is to apply resource, time and
effort in exchange of something later. You must consider if the
team is willing to invest in building better software.
Design Stamina Hypothesis
Martin Fowler
What is the scenario of your
system today?
statement
The system is completely guided by data and you can classify
it as a CRUD solution (create, read, update, delete). Your
team only needs a pretty interface for data manipulation.
scenario #1
statement
The system is completely guided by data and you can classify
it as a CRUD solution (create, read, update, delete). Your
team only needs a pretty interface for data manipulation.
scenario #1
diagnosis
You don't need to invest time and effort from your team to
practice DDD. That doesn't mean you should not worry
about code quality.
statement
The system requires only 30 or less business operations, is
probably very simple to have a overview of the system. This
means that your application don't have more than 30 use
cases (methods), and each one of them have minimal business
rules. Because of that, you don't feel lack of control by
business complexity. This is a common scenario for startups
doing their MVP.
scenario #2
statement
The system requires only 30 or less business operations, is
probably very simple to have a overview of the system. This
means that your application don't have more than 30 use
cases (methods), and each one of them have minimal business
rules. Because of that, you don't feel lack of control by
business complexity. This is a common scenario for startups
doing their MVP.
scenario #2
diagnosis
You could even have a challenge in your mind right now, but
practicing DDD is a high cost because you didn't feel the pain
of complexity yet. Maybe is the moment to gather domain
experts and evolve the ubiquitous language.
What you can do
■ Evolve ubiquitous language
■ Use a tool that analyzes the code (rubocop, code
climate, source level, etc)
■ Make an organized mess
■ Analyze software metrics like Churn vs Complexity
How to start building ubiquitous
language
Gather domain
experts to talk
Create a glossary
of terms that are
relevant
Photo by You X Ventures on Unsplash
Try to find a
knowledge in
common
Document flow
from product and
technical point of
view
Use tools to analyze code
Analyze software metrics
Churn vs Complexity
Churn
It is a measure of how often a file changes. Files
that change more have bigger churn.
Complexity
Usually is calculated by Cyclomatic Complexity,
which calculates the quantity of independent
paths your code have (control transferences,
logical sequences, etc)
🔥☠️🔥
🔥☠️🔥
Make an organized mess
Talk made by Sandi Metz: "Go ahead, make
a mess"
Sandi Metz
Sandi Metz
Public API
Sandi Metz
Public API
Sandi Metz
expose
Public API
Sandi Metz
expose
Private behaviour
Public API
Sandi Metz
expose
Private behaviour
hide
Public API
Sandi Metz
expose
Private behaviour
hide
Dependencies Dependencies
Public API
Sandi Metz
expose
Private behaviour
hide
Dependencies Dependencies
minimize
Public API
Sandi Metz
expose
Private behaviour
hide
Dependencies Dependencies
minimize move
"What's the future cost of doing
nothing now?"
Sandi Metz, from talk "Go ahead, make a mess"
statement
Let's say that you moved from 30 to 40 features and your
starting to question complexity of things that need to be
done. The system may not be maintained by an unique team,
but by multidisciplinary teams. You are thoughtful about
product evolution inside each team, and questioning if is
possible to keep a stable system with code quality and
reliable architecture.
scenario #3
statement
Let's say that you moved from 30 to 40 features and your
starting to question complexity of things that need to be
done. The system may not be maintained by an unique team,
but by multidisciplinary teams. You are thoughtful about
product evolution inside each team, and questioning if is
possible to keep a stable system with code quality and
reliable architecture.
scenario #3
diagnosis
You are coming close to the point where there is a real
benefit in making code design: The benefit of productivity
and being happy. Your team should start talking about code
design (including DDD)
What you can do
■ If possible, distribute senior people across the teams, ensuring that
the team have at least one person with experience in designing code
(and failing)
■ Make periodical checks to talk about code quality and architecture
(with team leaders). Like a code therapy.
■ Make fishbowls/meetups with product managers and developers to
talk about it and analyze opportunities.
■ Start DDD with Strategic Modeling, never Tactical Patterns
Start practicing DDD with
Strategic Modeling
Don't start with tactical patterns. For real.
Strategic Modeling vs Tactical
Strategic Modeling gives you
boundaries and clear definition
of your system
Strategic Modeling
■ Ubiquitous language
■ Defining domain and subdomain
■ Defining bounded contexts
■ Context maps
Defining bounded contexts
It's a component so important as ubiquitous language when practicing DDD
Is how DDD deals with models of big subdomains:
Separating they by business intentions.
Ecommerce system
Domain
Ecommerce system
Domain
Ecommerce system
Domain
exercise
■ Make a list of every subdomain you remember in your
routine
■ Make a list of bounded contexts
■ Use a template to understand how bounded contexts
communicate between them.
■ Do it and redo it as many times as necessary
statement
Too many people and features to be managed. Requirements
change and this requires lot of effort from the team in
thinking about how to maintain current code and still make
the necessary changes without breaking the system.
scenario #4
statement
Muitas pessoas e features para serem administradas. Os
requisitos mudam e isso requer muito esforço do time em
pensar como manter o código atual e ainda fazer as
mudanças necessárias sem que outras coisas quebrem no
sistema.
scenario #4
statement
Too many people and features to be managed. Requirements
change and this requires lot of effort from the team in
thinking about how to maintain current code and still make
the necessary changes without breaking the system.
scenario #4
diagnosis
The time has come and you should invest in code design and
practice DDD as much as possible. It's time to plan system
changes.
statement
Too many people and features to be managed. Requirements
change and this requires lot of effort from the team in
thinking about how to maintain current code and still make
the necessary changes without breaking the system.
scenario #4
diagnosis
Chegou o momento esperado de investir em design de código
e praticar DDD o quanto for possível. É hora de planejar
mudanças no seu sistema.
What you can do
■ Collect all the effort from Strategic Modeling to use tactical
patterns
■ Make a plan and focus on execution
Questions during planning
What software resources already
exist and can be reused?
What software resources will need
to be created from scratch?
How many effort we want to put in
these resources that are being
created from scratch?
Is there any integration between
contexts that will need to be made
from scratch too?
Strategic Modeling + Tactical Pattern
Tactical Patterns
They are also more practical than Strategic Modeling. It is worth mentioning that
these patterns are applied within a bounded context.
Resources closer to the code
A few patterns
■ Value Objects
■ Entities
■ Domain Services
■ Repositories
■ Aggregates
Purpose of each pattern
Patterns of relationship
between bounded contexts
■ Shared Kernel
■ Customer/Supplier
■ Conformist
■ Partner
■ Anti Corruption Layer
Think carefully before choosing
Think carefully before choosing
Content about DDD
Implementing DDD, Vaughn Vernon
Tactical Domain Driven Design
Strategic Practices of DDD
Code is only a way of bringing
more value to the business
Code is only a tool to help
people
Thank you!
@carolkarklis

Weitere ähnliche Inhalte

Ähnlich wie Finding balance of DDD while your application grows

Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestors
Uwe Friedrichsen
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Clean Code - Increase your agility through higher quality software
Clean Code - Increase your agility through higher quality softwareClean Code - Increase your agility through higher quality software
Clean Code - Increase your agility through higher quality software
Eric Reichwaldt
 
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINALJun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Alex Tarra
 

Ähnlich wie Finding balance of DDD while your application grows (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
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestors
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Building Maintainable PHP Applications.pptx
Building Maintainable PHP Applications.pptxBuilding Maintainable PHP Applications.pptx
Building Maintainable PHP Applications.pptx
 
Agile architecture upload
Agile architecture uploadAgile architecture upload
Agile architecture upload
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
Up to speed in domain driven design
Up to speed in domain driven designUp to speed in domain driven design
Up to speed in domain driven design
 
SOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDDSOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDD
 
DOMAIN DRIVER DESIGN
DOMAIN DRIVER DESIGNDOMAIN DRIVER DESIGN
DOMAIN DRIVER DESIGN
 
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
 
Old Is the New New
Old Is the New NewOld Is the New New
Old Is the New New
 
Gluing it all together: How teams can build enterprise JavaScript application...
Gluing it all together: How teams can build enterprise JavaScript application...Gluing it all together: How teams can build enterprise JavaScript application...
Gluing it all together: How teams can build enterprise JavaScript application...
 
Clean Code - Increase your agility through higher quality software
Clean Code - Increase your agility through higher quality softwareClean Code - Increase your agility through higher quality software
Clean Code - Increase your agility through higher quality software
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINALJun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
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
 
Design Systems: Enterprise UX Evolution
Design Systems: Enterprise UX EvolutionDesign Systems: Enterprise UX Evolution
Design Systems: Enterprise UX Evolution
 

Kürzlich hochgeladen

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 

Finding balance of DDD while your application grows

  • 2. @carolkarklis 🏄♀️🍺💃 Software Developer at Magnetis Ruby e Elixir ❤️ Cats <3 Diversity and Inclusion 💖 Brazilian 🇧🇷
  • 3. 01 Big picture of Domain Driven Design (DDD) schedule 02 Why practicing DDD? 03 Starting with DDD 04 Approaches for each scenario @carolkarklis
  • 4. Motivation behind this talk came from a tech event Photo by James Pond on Unsplash @carolkarklis
  • 5. When is it the right time to pay more attention in the code and architecture?
  • 6. What is the balance of software development?
  • 7. Go horse Balance Code balance Overengineering 🐴 💣
  • 8. Goal of this talk ■ Understand big picture of DDD ■ Be able to identify the current situation of business ■ Know the best approach given the current situation ■ Inspire and encourage the vision of bringing business value through code @carolkarklis
  • 10. DDD means Domain Driven Design
  • 11. Business domain guides project development
  • 12. Domain is a group of things that company does to solve a problem
  • 13. Domain is how the company do their business
  • 17. Ubiquitous language Is one of the pillars of Domain Driven Design
  • 18. What is NOT ■ Business language (jargons, terms, etc) Photo by Hans-Peter Gauster on Unsplash
  • 19. What is NOT ■ Business language (jargons, terms, etc) ■ Communication of domains experts Photo by Hans-Peter Gauster on Unsplash
  • 20. What is NOT ■ Business language (jargons, terms, etc) ■ Communication of domains experts ■ A way of naming things in the code Photo by Hans-Peter Gauster on Unsplash
  • 21. What is NOT ■ Business language (jargons, terms, etc) ■ Communication of domains experts ■ A way of naming things in the code ■ The way developers communicate about the system Photo by Hans-Peter Gauster on Unsplash
  • 22. What is NOT ■ Business language (jargons, terms, etc) ■ Communication of domains experts ■ A way of naming things in the code ■ The way developers communicate about the system ■ Communication about how the system should work (speculative) Photo by Hans-Peter Gauster on Unsplash
  • 23. "The practice of building up a common, rigorous language between developers and users" Eric Evans
  • 24. Ubiquitous language It is based on domain model and express how the system works in an understandable way for everyone in the team A language about a shared knowledge of domain made by the team
  • 25. Code that expresses what the domain does
  • 26. "When implementing DDD, is expected that code design is questioned" Vaughn Vernon, from the book Implementing Domain-Driven Design
  • 27. Why practicing DDD? (or how to convince your team to dedicate time in this practice)
  • 28. Photo by Benjamin Behre on Unsplash Decrease of knowledge island
  • 29. Photo by NeONBRAND on Unsplash A precise and understandable definition of the business being developed
  • 30. Photo by Sabine Peters on Unsplash Code maintenance gets easier and less expensive
  • 31. Photo by Brad Barmore on Unsplash Continuous modeling of the system
  • 32. Photo by NESA by Makers on Unsplash More efficient development due the use of ubiquitous language
  • 33. I believe that everyone can benefit from practicing DDD
  • 34. But the investment in DDD will depend on company moment
  • 35. Investments takes time The definition of investment is to apply resource, time and effort in exchange of something later. You must consider if the team is willing to invest in building better software.
  • 36.
  • 37.
  • 39.
  • 40.
  • 41. What is the scenario of your system today?
  • 42. statement The system is completely guided by data and you can classify it as a CRUD solution (create, read, update, delete). Your team only needs a pretty interface for data manipulation. scenario #1
  • 43. statement The system is completely guided by data and you can classify it as a CRUD solution (create, read, update, delete). Your team only needs a pretty interface for data manipulation. scenario #1 diagnosis You don't need to invest time and effort from your team to practice DDD. That doesn't mean you should not worry about code quality.
  • 44. statement The system requires only 30 or less business operations, is probably very simple to have a overview of the system. This means that your application don't have more than 30 use cases (methods), and each one of them have minimal business rules. Because of that, you don't feel lack of control by business complexity. This is a common scenario for startups doing their MVP. scenario #2
  • 45. statement The system requires only 30 or less business operations, is probably very simple to have a overview of the system. This means that your application don't have more than 30 use cases (methods), and each one of them have minimal business rules. Because of that, you don't feel lack of control by business complexity. This is a common scenario for startups doing their MVP. scenario #2 diagnosis You could even have a challenge in your mind right now, but practicing DDD is a high cost because you didn't feel the pain of complexity yet. Maybe is the moment to gather domain experts and evolve the ubiquitous language.
  • 46. What you can do ■ Evolve ubiquitous language ■ Use a tool that analyzes the code (rubocop, code climate, source level, etc) ■ Make an organized mess ■ Analyze software metrics like Churn vs Complexity
  • 47. How to start building ubiquitous language
  • 49. Create a glossary of terms that are relevant Photo by You X Ventures on Unsplash
  • 50. Try to find a knowledge in common
  • 51. Document flow from product and technical point of view
  • 52. Use tools to analyze code
  • 53.
  • 55. Churn It is a measure of how often a file changes. Files that change more have bigger churn.
  • 56. Complexity Usually is calculated by Cyclomatic Complexity, which calculates the quantity of independent paths your code have (control transferences, logical sequences, etc)
  • 57.
  • 60. Make an organized mess Talk made by Sandi Metz: "Go ahead, make a mess"
  • 61.
  • 68. Public API Sandi Metz expose Private behaviour hide Dependencies Dependencies
  • 69. Public API Sandi Metz expose Private behaviour hide Dependencies Dependencies minimize
  • 70. Public API Sandi Metz expose Private behaviour hide Dependencies Dependencies minimize move
  • 71.
  • 72. "What's the future cost of doing nothing now?" Sandi Metz, from talk "Go ahead, make a mess"
  • 73. statement Let's say that you moved from 30 to 40 features and your starting to question complexity of things that need to be done. The system may not be maintained by an unique team, but by multidisciplinary teams. You are thoughtful about product evolution inside each team, and questioning if is possible to keep a stable system with code quality and reliable architecture. scenario #3
  • 74. statement Let's say that you moved from 30 to 40 features and your starting to question complexity of things that need to be done. The system may not be maintained by an unique team, but by multidisciplinary teams. You are thoughtful about product evolution inside each team, and questioning if is possible to keep a stable system with code quality and reliable architecture. scenario #3 diagnosis You are coming close to the point where there is a real benefit in making code design: The benefit of productivity and being happy. Your team should start talking about code design (including DDD)
  • 75. What you can do ■ If possible, distribute senior people across the teams, ensuring that the team have at least one person with experience in designing code (and failing) ■ Make periodical checks to talk about code quality and architecture (with team leaders). Like a code therapy. ■ Make fishbowls/meetups with product managers and developers to talk about it and analyze opportunities. ■ Start DDD with Strategic Modeling, never Tactical Patterns
  • 76. Start practicing DDD with Strategic Modeling Don't start with tactical patterns. For real.
  • 78. Strategic Modeling gives you boundaries and clear definition of your system
  • 79. Strategic Modeling ■ Ubiquitous language ■ Defining domain and subdomain ■ Defining bounded contexts ■ Context maps
  • 80. Defining bounded contexts It's a component so important as ubiquitous language when practicing DDD Is how DDD deals with models of big subdomains: Separating they by business intentions.
  • 84. exercise ■ Make a list of every subdomain you remember in your routine ■ Make a list of bounded contexts ■ Use a template to understand how bounded contexts communicate between them. ■ Do it and redo it as many times as necessary
  • 85. statement Too many people and features to be managed. Requirements change and this requires lot of effort from the team in thinking about how to maintain current code and still make the necessary changes without breaking the system. scenario #4
  • 86. statement Muitas pessoas e features para serem administradas. Os requisitos mudam e isso requer muito esforço do time em pensar como manter o código atual e ainda fazer as mudanças necessárias sem que outras coisas quebrem no sistema. scenario #4
  • 87. statement Too many people and features to be managed. Requirements change and this requires lot of effort from the team in thinking about how to maintain current code and still make the necessary changes without breaking the system. scenario #4 diagnosis The time has come and you should invest in code design and practice DDD as much as possible. It's time to plan system changes.
  • 88. statement Too many people and features to be managed. Requirements change and this requires lot of effort from the team in thinking about how to maintain current code and still make the necessary changes without breaking the system. scenario #4 diagnosis Chegou o momento esperado de investir em design de código e praticar DDD o quanto for possível. É hora de planejar mudanças no seu sistema.
  • 89. What you can do ■ Collect all the effort from Strategic Modeling to use tactical patterns ■ Make a plan and focus on execution
  • 91. What software resources already exist and can be reused?
  • 92. What software resources will need to be created from scratch?
  • 93. How many effort we want to put in these resources that are being created from scratch?
  • 94. Is there any integration between contexts that will need to be made from scratch too?
  • 95. Strategic Modeling + Tactical Pattern
  • 96. Tactical Patterns They are also more practical than Strategic Modeling. It is worth mentioning that these patterns are applied within a bounded context. Resources closer to the code
  • 97. A few patterns ■ Value Objects ■ Entities ■ Domain Services ■ Repositories ■ Aggregates
  • 98. Purpose of each pattern
  • 99. Patterns of relationship between bounded contexts ■ Shared Kernel ■ Customer/Supplier ■ Conformist ■ Partner ■ Anti Corruption Layer
  • 102. Content about DDD Implementing DDD, Vaughn Vernon Tactical Domain Driven Design Strategic Practices of DDD
  • 103. Code is only a way of bringing more value to the business
  • 104. Code is only a tool to help people

Hinweis der Redaktion

  1. É um jeito de fazer código
  2. Is how the company do their business
  3. Is how the company do their business
  4. teste
  5. teste
  6. A verdade é que nós desenvolvedores somos péssimos pra identificar quando algo começa a ficar complexo
  7. Nesse ponto tudo muda. Se o time não conseguir pegar tempo pra fazer um bom design,a performance começa a cair porque o sistema vai ficando mais engessado e difícil de modificar. Com um bom design, a performance fica mais constante e é possível ter mais entregas do que um sistema com nenhum ou péssimo design
  8. Não precisa ser algo formal e nem muito organizado. Você pode pegar um fluxo e pedir para o especialista explicar. Por exemplo: Como funciona o fluxo de resgate?
  9. É ISSO que você quer extrair da conversa: conceitos e palavras em comum. É assim que você testa se a linguagem do seu código reflete a realidade, e é assim que você constrói a linguagem ubíqua
  10. Depois dessa conversa, documente ela no papel. Como esse fluxo funciona? O que é importante de ser dito sobre ele? A ideia não é manter uma documentação 100% fiel ao código o tempo todo, mas sim extrair os conhecimentos da reunião pra algo mais duradouro Depois de documentar o fluxo, envie para os especialistas e outros desenvolvedores. Esse é um ótimo exercício
  11. Falar do rubocop e source level
  12. Falar do rubocop e source level
  13. Falar do rubocop e source level
  14. Fazer fishbowls com o time de dev pra discutir sobre qualidade de código e espalhar conhecimento em design Se possível, fazer com que cada time tenha pelo menos uma pessoa com experiência em design de código Fazer checks periódicos Aproveite a oportunidade de lançar uma feature para fazer ela do zero, e não refatorar algo que vc já tem dificuldade de usar Não deixe a discussão sobre produto longe de refactor/design de código. Quanto mais perto, quanto mais vc mostrar a preocupação para os PM's, mais fácil Tentar encaixar o Shapeup aqui
  15. DDD deals with large models by dividing them into different Bounded Contexts and being explicit about their interrelationships.
  16. Vamos pensar nesse domínio: Ele tem intenções e contextos diferentes. O que um usuário significa em cada um desses subdomínios? Por exemplo, o termo CLIENTE pode ter vários significados Quando o usuario tá na vitrine, é uma coisa Quando faz o pedido, outra No pedido é bem limitado, o CLIENTE representa pouca coisa: eu só quero saber o tipo de pagamento e um endereço de entrega dele Agora vamos falar de intenções QUal a intenção de tudo isso? Vender um produto? Quase tudo é sobre vender um produto A vitrine existe porque ela quer que você compre. A experiência que voce tem com pedido e entrega pode fazer você comprar mais. Contabilidade é consequencia da compra Mas eu diria que a intenção do ESTOQUE é diferenciada de todas as outras. A intenção de negócio pra existencia do estoque é ter visibilidade do que se tem disponível a venda. A quantidade das coisas pra serem vendidas. Isso pode ajudar a definir o que entra numa promoção, por exemplo. São intenções diferentes. Então, nesse exemplo, eu vou separar o estoque dos outros, como bounded contexts diferentes.
  17. Its almost certain that terms and meanings collide in the domain. For example, the term customer must have multiple meanings. When a user is browsing the catalog, customer means one thing. When placing an order, it means something else. Here's why: WHen browsing catalog, customer is being used in the context of previous purchase, loyalty, product availability, discounts. On the order, however, customer has a limited meaning. Customer means very little comparing to catalog: it's payment terms, ship-to address Nesse exemplo mais simples, a gente poderia dizer que a intenção de quase tudo que tá sendo exposto aí é vender um produto. Ponto. A vitrine existe porque ela quer que você compre. A experiência que voce tem com pedido e entrega pode fazer você comprar mais. Contabilidade é consequencia da compra Mas eu diria que a intenção do estoque é diferenciada de todas as outras. A intenção de negócio pra existencia do estoque é ter visibilidade do que se tem disponível a venda. A quantidade das coisas pra serem vendidas. Isso pode ajudar a definir o que entra numa promoção, por exemplo. São intenções diferentes. Então, nesse exemplo, eu vou separar o estoque dos outros, como bounded contexts diferentes.
  18. Its almost certain that terms and meanings collide in the domain. For example, the term customer must have multiple meanings. When a user is browsing the catalog, customer means one thing. When placing an order, it means something else. Here's why: WHen browsing catalog, customer is being used in the context of previous purchase, loyalty, product availability, discounts. On the order, however, customer has a limited meaning. Customer means very little comparing to catalog: it's payment terms, ship-to address Nesse exemplo mais simples, a gente poderia dizer que a intenção de quase tudo que tá sendo exposto aí é vender um produto. Ponto. A vitrine existe porque ela quer que você compre. A experiência que voce tem com pedido e entrega pode fazer você comprar mais. Contabilidade é consequencia da compra Mas eu diria que a intenção do estoque é diferenciada de todas as outras. A intenção de negócio pra existencia do estoque é ter visibilidade do que se tem disponível a venda. A quantidade das coisas pra serem vendidas. Isso pode ajudar a definir o que entra numa promoção, por exemplo. São intenções diferentes. Então, nesse exemplo, eu vou separar o estoque dos outros, como bounded contexts diferentes.
  19. is a set of technical resources used in the construction of your Domain Model, these resources must be applied to work in a single Bounded Context.