Successfully reported this slideshow.

Domain Driven Design: Zero to Hero

5

Share

Upcoming SlideShare
DDD knowledge sharing
DDD knowledge sharing
Loading in …3
×
1 of 86
1 of 86

More Related Content

Domain Driven Design: Zero to Hero

  1. 1. Domain Driven Design Zero to Hero Fabrício Rissetto
  2. 2. fabriciorissetto.com fabriciorissetto fabriciorissetto fabriciorissetto@gmail.com
  3. 3. Schedule ● Basic Concepts ● Ubiquitous Language ● Domain Expert ● Domain Model ● Architectures types ○ DDD, ○ Smart UI, ○ … ● Strategic Design ○ Bounded Context ○ Context Maps ○ Domain Events ○ Event Storming ● Tactical Design (building blocks) ○ Layered Architecture ○ Entities ○ Value Objects ○ Aggregates ○ Domain Services ○ Factories ○ Repositories ● CQRS ● SOA ○ Event Driven Architecture ● Event Sourcing ● Final Thoughts
  4. 4. Domain Expert
  5. 5. Ubiquitous Language
  6. 6. Domain == problem Model == solution Distilled knowledge​ “The model isn’t just the knowledge in a domain expert's head; it is a rigorously organized and selective abstraction of that.” - Eric Evans Can be expressed in several ways:​ ● Code ● Diagrams ● Written Documentation What is a Domain Model?
  7. 7. Ubiquitous Language
  8. 8. C#
  9. 9. C#
  10. 10. C#
  11. 11. C#
  12. 12. Ruby
  13. 13. Before we start ● An iterative process ● Business involvement (domain experts) ● Being fluent with Object-Oriented (OO) programming paradigm ● Being familiar with SOLID principles
  14. 14. Schedule ● Basic Concepts ● Ubiquitous Language ● Domain Expert ● Domain Model ● Architectures types ○ DDD, ○ Smart UI, ○ ... ● Strategic Design ○ Bounded Context ○ Context Maps ○ Domain Events ○ Event Storming ● Tactical Design (building blocks) ○ Layered Architecture ○ Entities ○ Value Objects ○ Aggregates ○ Domain Services ○ Factories ○ Repositories ● CQRS ● SOA ○ Event Driven Architecture ● Event Sourcing ● Final Thoughts
  15. 15. The Two Sides of Domain-Driven Design Tactical vs Strategic
  16. 16. DDD Tools Strategic Tactical
  17. 17. Strategic
  18. 18. Big Ball of Mud
  19. 19. Strategic
  20. 20. Effective design with Bounded Contexts
  21. 21. Contexts aren’t just folders or “packages” Everything could be a context Even a microservice...
  22. 22. Sales Support DDDDDD
  23. 23. Data-driven Context Sales Support Account CRUD!DDDDDD
  24. 24. Big Ball of Mud as a Context Sales Support Account DDD DDD CRUD
  25. 25. Big Ball of Mud as a Context Sales Support Account Payment Legacy (big ball of mud) DDD DDD CRUD
  26. 26. Squads Bounded Contexts
  27. 27. Strategic
  28. 28. Contex Map
  29. 29. Contex Map - Shared Kernel Contex Map - Customer/Supplier Contex Map - Conformist Contex Map - Partner Contex Map - Open Host Service Contex Map - Published Language
  30. 30. Contex Map - Shared Kernel
  31. 31. Contex Map - Anticorruption Layer
  32. 32. Integration Approaches
  33. 33. Strategic
  34. 34. Integrating between bounded contexts using Domain Events
  35. 35. Domain Events http://udidahan.com/2009/06/14/domain-events-salvation/
  36. 36. Domain Events
  37. 37. Schedule ● Basic Concepts ● Ubiquitous Language ● Domain Expert ● Domain Model ● Architectures types ○ DDD, ○ Smart UI, ○ ... ● Strategic Design ○ Bounded Context ○ Context Maps ○ Domain Events ○ Event Storming ● Tactical Design (building blocks) ○ Layered Architecture ○ Entities ○ Value Objects ○ Aggregates ○ Domain Services ○ Factories ○ Repositories ● CQRS ● SOA ○ Event Driven Architecture ● Event Sourcing ● Final Thoughts
  38. 38. Tactical
  39. 39. Layered Architecture Domain }Bounded Contexts
  40. 40. Layered Architecture } CRUD Context Bounded Contexts Domain
  41. 41. Layered Architecture
  42. 42. Tactical
  43. 43. Entities
  44. 44. Tactical
  45. 45. Value Objects
  46. 46. Mostrar money object… bem melhor pra mostrar vo
  47. 47. Tactical
  48. 48. Aggregates
  49. 49. Aggregates
  50. 50. Aggregates
  51. 51. Tactical
  52. 52. Domain Services
  53. 53. Domain Services VS Application Services
  54. 54. Domain Service vs Application Service Application Service Domain Services }
  55. 55. Application Service
  56. 56. Tactical
  57. 57. Factories
  58. 58. Factory Method
  59. 59. Factory Object
  60. 60. Tactical
  61. 61. Repositories Repositories
  62. 62. Schedule ● Basic Concepts ● Ubiquitous Language ● Domain Expert ● Domain Model ● Architectures types ○ DDD, ○ Smart UI, ○ ... ● Strategic Design ○ Bounded Context ○ Context Maps ○ Domain Events ○ Event Storming ● Tactical Design (building blocks) ○ Layered Architecture ○ Entities ○ Value Objects ○ Aggregates ○ Domain Services ○ Factories ○ Repositories ● CQRS ● SOA ○ Event Driven Architecture ● Event Sourcing ● Final Thoughts
  63. 63. CAMADINHAS
  64. 64. CQRS
  65. 65. CQRS Command
  66. 66. CQRS QueryCommand
  67. 67. Integrating between external contexts
  68. 68. EVENT SOURCING
  69. 69. Schedule ● Basic Concepts ● Ubiquitous Language ● Domain Expert ● Domain Model ● Architectures types ○ DDD, ○ Smart UI, ○ ... ● Strategic Design ○ Bounded Context ○ Context Maps ○ Domain Events ○ Event Storming ● Tactical Design (building blocks) ○ Layered Architecture ○ Entities ○ Value Objects ○ Aggregates ○ Domain Services ○ Factories ○ Repositories ● CQRS ● SOA ○ Event Driven Architecture ● Event Sourcing ● Final Thoughts
  70. 70. Referências https://github.com/VaughnVernon/IDDD_Samples_NET https://github.com/heynickc/awesome-ddd
  71. 71. Obrigado! fabriciorissetto@gmail.com fabriciorissetto

×