Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Focus on the essece with Domain-Driven Design

135 views

Published on

Stop solving the wrong problem and focus on the essence with Domain-Driven Design.

This talk show a typical complicated solution to an online store pricing problem, and how the problem can be solved simplier with DDD.
You'll also find out how to start with DDD right now.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Focus on the essece with Domain-Driven Design

  1. 1. Svaťa Šimara Stop Solving the Wrong Problem Focus on the Essence Stop Solving the Wrong Problem Focus on the Essence Domain-Driven Design
  2. 2. Before I Start
  3. 3. Business Value
  4. 4. • Clean • SOLID • TDD • 12factor • CQRS • DDD • ... Perfect Code
  5. 5. Business Value
  6. 6. Long Term Support?
  7. 7. Maintenance Cost?
  8. 8. Online Store Story (e-shop)
  9. 9. Couple of Products
  10. 10. VIP Price
  11. 11. Price Lists
  12. 12. Price Lists
  13. 13. Store is Slow
  14. 14. Price Calculation as DB Function
  15. 15. Store is Successful
  16. 16. You Solve Everyday Issues
  17. 17. Everybody is Happy
  18. 18. Store is Slowing Down
  19. 19. The DB Function is Slow
  20. 20. Nightly Pre-Calculated Prices
  21. 21. Problem is Solved
  22. 22. New Programmer
  23. 23. • Why is pricing so coplicated? New Programmer
  24. 24. • Why is pricing so coplicated? • Why is not the price changed immediatelly? New Programmer
  25. 25. • Why is pricing so coplicated? • Why is not the price changed immediatelly? • Why isn’t the pricing tested? New Programmer
  26. 26. • Why is pricing so coplicated? • Why is not the price changed immediatelly? • Why isn’t the pricing tested? • Why is the price problem solved partially in DB, PHP, CRON? New Programmer
  27. 27. • Why is pricing so coplicated? • Why is not the price changed immediatelly? • Why isn’t the pricing tested? • Why is the price problem solved partially in DB, PHP, CRON? • I don’t want to deal with pricing, I would break something New Programmer
  28. 28. You are Solving the Wrong Problem
  29. 29. Current Problems
  30. 30. Technical Problems
  31. 31. You’ll Never End
  32. 32. Solution?
  33. 33. Change the Way You Deal with Problems
  34. 34. What?
  35. 35. Start Asking
  36. 36. What does it mean? What is the concept?
  37. 37. How do you use it? What are use-cases?
  38. 38. How do you call it? Does the concept even exist?
  39. 39. What really customer needs?
  40. 40. What is his domain?
  41. 41. Domain
  42. 42. • Area • Terms • Rules • From customer’s point of view Domain
  43. 43. Domain in the Store Story
  44. 44. • The pricing domain is partially in – PHP – Database – CRON – Programmer’s head Online Store Domain
  45. 45. How did It happen?
  46. 46. Small Shop: Product with Price
  47. 47. ✔ Small Shop: Product with Price
  48. 48. Need for VIP Price
  49. 49. Why does he need more prices?
  50. 50. How does he call them?
  51. 51. What is he achieving?
  52. 52. Instead of
  53. 53. You End Up with
  54. 54. • Regular Price • VIP Price You End Up with
  55. 55. • NO Price List concept You End Up with
  56. 56. • NO Price List concept • NO Database function You End Up with
  57. 57. • NO Price List concept • NO Database function • NO problems you’ve been solving all the time You End Up with
  58. 58. • Different mental model • Simpler model – Testable – Easy to explain – Maintanable – Changable You End Up with
  59. 59. • Different mental model • Simpler model – Testable – Easy to explain – Maintanable – Changable You End Up with
  60. 60. That’s the Point of DDD
  61. 61. Beat Complexity
  62. 62. Isolate the Domain
  63. 63. Communication & Understanding
  64. 64. DDD is Change of Thinking
  65. 65. Change is Not Easy
  66. 66. How Can You Start
  67. 67. How to Start Right Now
  68. 68. • Stop thinking about – DB structure How to Start Right Now
  69. 69. • Stop thinking about – DB structure – DB and data at all How to Start Right Now
  70. 70. • Stop thinking about – DB structure – DB and data at all – Framework you use How to Start Right Now
  71. 71. • Stop thinking about – DB structure – DB and data at all – Framework you use – Tools you know How to Start Right Now
  72. 72. • Ask questions How to Start Right Now
  73. 73. • Ask questions – Like 5 years old baby How to Start Right Now
  74. 74. • Ask questions – Like 5 years old baby – Fow who is it? How to Start Right Now
  75. 75. • Ask questions – Like 5 years old baby – Fow who is it? – What? How to Start Right Now
  76. 76. • Ask questions – Like 5 years old baby – Fow who is it? – What? – Why? How to Start Right Now
  77. 77. • Ask questions – Like 5 years old baby – Fow who is it? – What? – Why? • Solve problem on the paper first How to Start Right Now
  78. 78. • Ask questions – Like 5 years old baby – Fow who is it? – What? – Why? • Solve problem on the paper first • Use domain terms How to Start Right Now
  79. 79. • Ask questions – Like 5 years old baby – Fow who is it? – What? – Why? • Solve problem on the paper first • Use domain terms • Don’t abstract How to Start Right Now
  80. 80. DDD is Not
  81. 81. • Architecture – Hexagonal – Onion DDD is Not
  82. 82. • Architecture – Hexagonal – Onion • CQRS DDD is Not
  83. 83. • Architecture – Hexagonal – Onion • CQRS • Event Sourcing DDD is Not
  84. 84. • Architecture – Hexagonal – Onion • CQRS • Event Sourcing • Technology DDD is Not
  85. 85. • Architecture – Hexagonal – Onion • CQRS • Event Sourcing • Technology • Framework • … DDD is Not
  86. 86. • Domain DDD is
  87. 87. • Domain • Domain terms DDD is
  88. 88. • Domain • Domain terms • Use Cases DDD is
  89. 89. • svatasimara.cz • Series of articles • Examples in PHP • On-line lecture (czech) Sources
  90. 90. Domain-Driven Design svatasimara.cz

×