Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Réconcilier architecture logicielle & problémat...

Réconcilier architecture logicielle & problématiques métiers : une introduction au Domain Driven Design – Blend Web Mix 2021

Avez-vous déjà vécu le fait qu’un petit changement dans le métier déclenche une apocalypse dans le code du logiciel ? Ce genre de symptômes sont souvent le signe que l’architecture du logiciel et le métier de l’entreprise ne sont plus alignés.
Dans cette conférence nous verrons comment permettre aux développeurs d’exprimer les besoins métiers au sein de l’architecture du logiciel afin d’éviter toute une catégorie de problèmes. Problèmes à l’origine d’effets de bords particulièrement dangereux et qui empêchent une politique de refactoring efficace.
Cette présentation des aspects stratégiques de la conception pilotée par le domaine (Domain Driven Design) n’est pas une présentation technique, elle s’adresse ainsi à la fois aux développeurs mais également à l’ensemble des parties prenantes liées à la conception du logiciel.

Arnaud LEMAIRE

June 14, 2021
Tweet

More Decks by Arnaud LEMAIRE

Other Decks in Programming

Transcript

  1. Sprint Zero Java or C# ? Spring Boot or Quarkus

    ? Kafka or Redis ? Angular or React ?
  2. Sprint Zero Java or C# ? Spring Boot or Quarkus

    ? Kafka or Redis ? Microservices or Monolith ? Angular or React ?
  3. Sprint Zero Java or C# ? Spring Boot or Quarkus

    ? Kafka or Redis ? Microservices or Monolith ? Kubernetes or Nomad ? Angular or React ?
  4. Look, at our spring boot application with Kafka deployed on

    a K8S Cluster They know nothing about the project’s business domain Sprint Zero
  5. Look, at our spring boot application with Kafka deployed on

    a K8S Cluster They know nothing about the project’s business domain … Sprint Zero
  6. Java or C# ? Spring Boot or Quarkus ? Kafka

    or Redis ? Microservices or Monolith ? Kubernetes or Nomad ? Angular or React ? These issues address only the solution
  7. Spring Boot or Quarkus ? Kafka or Redis ? Microservices

    or Monolith ? Kubernetes or Nomad ? Angular or React ? And that's why we are seen as technical expert Java or C# ?
  8. solution problem What should we do ? How are we

    going to do it ? It is an important discussion to have
  9. solution problem What should we do ? How are we

    going to do it ? It is an important discussion to have But only after we've fi gured out 
 what to do
  10. « Donnez un marteau à un enfant, et il trouvera

    que tout a besoin d'être martelé. » – Abraham Kaplan
  11. « On fait passer les besoins de la base de

    donnée avant ceux des utilisateurs ce qui donne des expériences assez pourries » – @WalterStephanie
  12. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store
  13. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store You need to acknowledge the fact that you have several domains
  14. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store
  15. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store Only one VP should be angry at a time
  16. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store These are neither Bounded Contexts nor Microservices
  17. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Retail Store These are your domains
  18. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Online Retail Store Payment processor Catalogue Invoicing
  19. Domain Mapping Business Domain Classi fi cation Authoring & Publishing

    Customer Care Printing & Supply Chain Online Retail Store Payment processor Catalogue Invoicing Your domains contain domains
  20. Supporting Subdomain Generic Subdomain Core (sub)Domain Key differentiator Domains &

    Subdomains Business Domain Classi fi cation Critical to the 
 organization’s success
  21. Supporting Subdomain Generic Subdomain Core (sub)Domain Key differentiator Domains &

    Subdomains Business Domain Classi fi cation Essential to the 
 organization’s success Critical to the 
 organization’s success
  22. Supporting Subdomain Generic Subdomain Core (sub)Domain Key differentiator Domains &

    Subdomains Business Domain Classi fi cation Essential to the 
 organization’s success Required for the 
 organization’s success Critical to the 
 organization’s success
  23. Domain Mapping Business Domain Classi fi cation Authoring Plateform Publishing

    & Printing Inventory Management Payment Processor Catalogue Invoicing Shipping Order Processing Proofreading
  24. Domains & Subdomains Business Domain Classi fi cation Authoring Plateform

    Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing Publishing & Printing Proofreading
  25. Domains & Subdomains Business Domain Classi fi cation Authoring Plateform

    Inventory Management Payment Processor Catalogue Invoicing Shipping Order Processing Publishing & Printing Proofreading
  26. Domains & Subdomains Business Domain Classi fi cation Authoring Plateform

    Inventory Management Payment Processor Catalogue Invoicing Each business context is speci fi c Shipping Order Processing Publishing & Printing Proofreading
  27. Authoring Plateform Domains’ Connexion Reveal Business Relationships Inventory Management Shipping

    Catalogue Invoicing Order Processing Payment Processor Publishing & Printing Proofreading
  28. Authoring Plateform Domains’ Connexion Reveal Business Relationships Inventory Management Shipping

    Catalogue Invoicing Order Processing Payment Processor It can highlight signi fi cant 
 sub-domain Publishing & Printing Proofreading
  29. Authoring Plateform Domains’ Connexion Reveal Business Relationships Inventory Management Shipping

    Catalogue Invoicing Order Processing Payment Processor It can highlight signi fi cant 
 sub-domain Publishing & Printing Proofreading
  30. From Problem to Solution Authoring Plateform Publishing & Printing Inventory

    Management Shipping Payment Processor Catalogue Invoicing Order Processing Proofreading
  31. From Problem to Solution Authoring Plateform Publishing & Printing Inventory

    Management Shipping Payment Processor Catalogue Invoicing Order Processing problem solution Payment processor Invoicing Order Processing Shipping Authoring Plateforme Inventory Management Catalogue Publishing Proofreading Proofreading Inventory E-commerce platform Authoring Publishing
  32. Domains & Subdomains Development Strategy Supporting Subdomain Generic Subdomain Core

    (sub)Domain In-House development 
 with Your best teams Key differentiator
  33. Domains & Subdomains Development Strategy Supporting Subdomain In-House development with

    
 external support if possible Generic Subdomain Core (sub)Domain In-House development 
 with Your best teams Key differentiator
  34. Domains & Subdomains Development Strategy Supporting Subdomain In-House development with

    
 external support if possible Generic Subdomain Outsourcing is an option Core (sub)Domain In-House development 
 with Your best teams Key differentiator
  35. Domains & Subdomains Development Strategy Supporting Subdomain Generic Subdomain Core

    (sub)Domain Custom-made software High Cost & Quality Key differentiator
  36. Domains & Subdomains Development Strategy Supporting Subdomain Customized Off The

    Shelf Software 
 is an option Generic Subdomain Core (sub)Domain Custom-made software High Cost & Quality Key differentiator
  37. Domains & Subdomains Development Strategy Supporting Subdomain Customized Off The

    Shelf Software 
 is an option Generic Subdomain Try to fi nd Off The Shelf solution Cost saving opportunities Core (sub)Domain Custom-made software High Cost & Quality Key differentiator
  38. From Problem to Solution Payment processor Invoicing Order Processing Shipping

    Authoring Plateforme Inventory Management Catalogue Publishing Proofreading Inventory E-commerce platform Authoring Publishing Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing Proofreading
  39. From Problem to Solution Inventory E-commerce platform Authoring Authoring Plateforme

    Publishing Catalogue Publishing Proofreading Authoring Plateform Publishing & Printing Inventory Management Shipping Payment Processor Catalogue Invoicing Order Processing Proofreading
  40. From Problem to Solution Business Domain & Architecture alignment Inventory

    E-commerce platform Authoring Authoring Plateforme Publishing Catalogue Publishing Proofreading
  41. From Problem to Solution Business Domain & Architecture alignment Inventory

    E-commerce platform Authoring Authoring Plateforme Publishing Catalogue Publishing Proofreading These are your bounded contexts
  42. Inventory E-commerce platform Authoring Publishing « Team assignments are the

    fi rst draft of the architecture » – Michael Nygard
  43. Inventory E-commerce platform Authoring Publishing Align your teams with your

    bounded context « Team assignments are the fi rst draft of the architecture » – Michael Nygard
  44. Authoring Publishing E-commerce Specific Architecture style You don’t need one

    architectural style ES CQRS CRUD ? Stripe ShipMonk Shopify
  45. Authoring Publishing E-commerce Specific Architecture style You don’t need one

    architectural style Beware of the CRUD ES CQRS CRUD ? Stripe ShipMonk Shopify
  46. Stripe Still no microservices Bounded Context ≠ Deployment units ShipMonk

    Authoring Publishing E-commerce Shopify Deployment Unit
  47. Deployment Unit Stripe Still no microservices Bounded Context ≠ Deployment

    units ShipMonk Authoring Publishing E-commerce Shopify Deployment Unit
  48. Domains are not immutable Understanding is a never-ending process Stripe

    ShipMonk Authoring Publishing E-commerce Shopify
  49. Domains are not immutable Understanding is a never-ending process Stripe

    ShipMonk Authoring Publishing E-commerce Shopify Printing
  50. Semantic Boundaries Between BC meaning are different Authoring Publishing Book

    Chapter Chapter What happens if the author revises his book?
  51. Semantic Boundaries Between BC meaning are different Authoring Publishing Book

    Chapter Chapter They are not the same book What happens if the author revises his book?
  52. Semantic Boundaries Between BC meaning are different Chapter This is

    why you must start by understand strategically your domain Author Book Reviews Release Catalogue
  53. Semantic Boundaries Between BC meaning are different Authoring Publishing Book

    Chapter Chapter Book Chapter Chapter Inside a Bounded Context, 
 Don’t 
 Repeat 
 Yourself
  54. Semantic Boundaries Between BC meaning are different Authoring Publishing Book

    Chapter Chapter Book Chapter Chapter Inside a Bounded Context, 
 Don’t 
 Repeat 
 Yourself Between Bounded Context, 
 Write 
 Everything 
 Twice
  55. Don’t cross them Between BC meaning are different Authoring Publishing

    Author Reviews Author Book Book Release Never create relationships between entities from two BC
  56. Don’t cross them Between BC meaning are different Authoring Publishing

    Book Book Release Author Author Reviews This is exactly the same
  57. Don’t cross them Between BC meaning are different Authoring Publishing

    Book Book Release Author Author Reviews API API
  58. Same for Events Between BC meaning are different Authoring Publishing

    Event 
 Bus Book Book Release Author Author Reviews
  59. Same for Events Between BC meaning are different Authoring Publishing

    Event 
 Bus Book Book Release Author Author Reviews
  60. Same for Events Between BC meaning are different Authoring Publishing

    This is exactly the same Event 
 Bus Book Book Release Author Author Reviews
  61. Same for Events Between BC meaning are different Authoring Publishing

    Event 
 Bus Book Book Release Author Author Reviews Translator Translator
  62. Transactional Boundaries Protect your integrity Authoring Book Chapter Chapter Chapter

    Statistics Inside your bounded Context 
 live 
 Entities
  63. Transactional Boundaries Protect your integrity Authoring Book Chapter Chapter Chapter

    Statistics Inside your bounded Context 
 live 
 Entities They are grouped in Aggregates
  64. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    Inside an aggregate, Entities 
 share the same lifecycle
  65. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    They are retrieved and persisted 
 as a whole Inside an aggregate, Entities 
 share the same lifecycle
  66. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    Who ensures the aggregate integrity All interactions are done through the Aggregate Root
  67. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    Who ensures the aggregate integrity All interactions are done through the Aggregate Root Write a new chapter
  68. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    But don’t put to much in it Author What happens if we delete the book ?
  69. Transactional Boundaries Protect your integrity Book Chapter Chapter Chapter Statistics

    But don’t put to much in it Author What happens if we delete the book ? They must share the same lifecycle
  70. Designing Boundaries Protect your domain Printing Team We need printing

    margin Book Chapter Chapter Chapter Release API Publishing Team
  71. Designing Boundaries Protect your domain Printing Team We need printing

    margin Book Chapter Chapter Chapter Release Printing margin API Publishing Team
  72. Designing Boundaries Protect your domain Printing Team We need printing

    margin Book Chapter Chapter Chapter Release We need the colorimetric pro fi le Printing margin API Publishing Team
  73. Designing Boundaries Protect your domain Printing Team We need printing

    margin Book Chapter Chapter Chapter Release We need the colorimetric pro fi le Printing margin Colorimetric pro fi le API Publishing Team
  74. Designing Boundaries Protect your domain API We need printing margin

    Book Chapter Chapter Chapter Release We need the colorimetric pro fi le Printing margin Colorimetric pro fi le Domain Leakage Publishing Team Printing Team
  75. Designing Boundaries Protect your domain API We need printing margin

    Book Chapter Chapter Chapter Release We need the colorimetric pro fi le Printing margin Colorimetric pro fi le Domain Leakage Publishing Team Printing Team
  76. Designing Boundaries Protect your domain Publishing Team Printing Team Publishing

    API We need printing margin Book Printing margin Printing API
  77. Designing Boundaries Protect your domain Publishing Team Printing Team Publishing

    API We need printing margin Book We need the colorimetric pro fi le Printing margin Printing API
  78. Designing Boundaries Protect your domain Publishing Team Printing Team Publishing

    API We need printing margin Book We need the colorimetric pro fi le Printing margin Colorimetric pro fi le Printing API
  79. Designing Boundaries Protect your domain Publishing Team Printing Team Publishing

    API We need printing margin Book We need the colorimetric pro fi le Printing margin Colorimetric pro fi le Printing API We discovered the need 
 for an ACL
  80. CRUD don’t express behavior It blinds you from the business

    perspective UPDATE address Relocation Mistake correction
  81. CRUD don’t express behavior It blinds you from the business

    perspective UPDATE address Relocation Mistake correction
  82. CRUD don’t express behavior It blinds you from the business

    perspective Relocation Mistake correction
  83. Data oriented programming It obfuscates your code – Mathias Verraes

    $order->setStatus('paid') ; $order->setPaidAmount(120) ; $order->setPaidCurrency('EUR') ; $order->setCustomer($customer);
  84. Data oriented programming It obfuscates your code $money = new

    Money(120, new Currency(‘EUR')) ; $order->setPaidMoney($money); – Mathias Verraes $order->pay() ;
  85. Data oriented programming It obfuscates your code $money = new

    Money(120, new Currency(‘EUR')) ; $order->pay($customer, $money); – Mathias Verraes
  86. Data oriented programming It obfuscates your code $money = new

    Money(120, new Currency(‘EUR')) ; $order->pay($customer, $money); – Mathias Verraes $customer->pay($order, $money) ;
  87. Data oriented programming It obfuscates your code – Mathias Verraes

    $customer->pay($order, $money) ; $order->setStatus('paid') ; $order->setPaidAmount(120) ; $order->setPaidCurrency('EUR') ; $order->setCustomer($customer);
  88. A A A not « just » a glossary Ubiquitous

    language Stakeholders & Team Alignement Dev Domain 
 Expert Dev
  89. A A A not « just » a glossary Ubiquitous

    language Stakeholders & Team Alignement Dev Domain 
 Expert Dev
  90. Ubiquitous language Each BC has its own Authoring Publishing A

    A A A It is a common cause of miscommunication
  91. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User
  92. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User He has the last word regarding domain implementation
  93. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User Prioritize development & formalize users’ feedback
  94. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User Power of Life and Death over the project
  95. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User Too often forgotten
  96. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User Maybe you could spend a day per month working with them ?
  97. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User They design the software speci fi cation
  98. Know your users They might not be who you think

    they are Dev Domain 
 Expert Product 
 Owner Customer User What he understood goes 
 into production
  99. “A loosely coupled software architecture and org structure to match”

    is a key predictor of: — Michael Plöd (@bitboss)
  100. “A loosely coupled software architecture and org structure to match”

    is a key predictor of: • Continuous Delivery Performance — Michael Plöd (@bitboss)
  101. “A loosely coupled software architecture and org structure to match”

    is a key predictor of: • Continuous Delivery Performance • Ability to scale organization and increase performance linearly — Michael Plöd (@bitboss)
  102. “A loosely coupled software architecture and org structure to match”

    is a key predictor of: • Continuous Delivery Performance • Ability to scale organization and increase performance linearly This is what DDD is All About ! — Michael Plöd (@bitboss)