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.

Harnessing Domain Driven Design

1,366 views

Published on

Gayathri Thiyagarajan Lead Software Engineer - Capgemini
Andrew Harmel-Law Principal Software Engineer - Capgemini

Eric Evans’ Domain Driven Design (DDD) is a core text for all developers, and it's experiencing a renaissance due to the rise of microservices. But are most of us really applying DDD when we're "doing" distributed systems development? Gayathri and Andrew are going to argue that we're not, but we should be – we need to recalibrate.

We'll begin by laying out what DDD means to us based on experiences we've had building microservices with distributed teams over the last two years. We'll touch lightly on the well-understood elements such as "ubiquitous language", "intention revealing interfaces" and "hands on architects", before clarifying and explaining the much misapplied concept of "bounded contexts".

Finally we'll draw up in front of the largely ignored ones, such as the many patterns for inter-team communication which derive from "context maps". As we move away from the well-understood to the disregarded, we'll illustrate why these later ones are by far the most important to successful microservice-based projects.

We'll explain why they matter, and the bene ts you'll see from applying them. You will leave ready to apply the full power of DDD, and you'll have more fun as you do it.

  • Be the first to comment

Harnessing Domain Driven Design

  1. 1. Harnessing Domain Driven Design Gayathri Thiyagarajan Lead Software Engineer Capgemini Andrew Harmel Law Principal Software Engineer Capgemini
  2. 2. @YourTwitterHandle#YourSessionHashtag Harnessing Domain Driven Design for Distributed Systems Gayathri Thiyagarajan & Andrew Harmel-Law, Capgemini UK http://capgemini.github.io @gaythu_rajan / @al94781#harnessing_ddd
  3. 3. cc: kennymatic - https://www.flickr.com/photos/99472898@N00 @gaythu_rajan / @al94781#harnessing_ddd Who are we?
  4. 4. Who are we? @gaythu_rajan / @al94781#harnessing_ddd
  5. 5. “Microservice”? @gaythu_rajan / @al94781#harnessing_ddd
  6. 6. “Microservice”? (cont.) @gaythu_rajan / @al94781#harnessing_ddd
  7. 7. “Microservice”? (cont.) @gaythu_rajan / @al94781#harnessing_ddd
  8. 8. “Microservice”? (cont.) @gaythu_rajan / @al94781#harnessing_ddd
  9. 9. “Microservice”? (cont.) @gaythu_rajan / @al94781#harnessing_ddd
  10. 10. “Microservice”? (cont.) @gaythu_rajan / @al94781#harnessing_ddd
  11. 11. Microservices ROCK! cc: RaeAllen - https://www.flickr.com/photos/30628871@N00 @gaythu_rajan / @al94781#harnessing_ddd
  12. 12. Microservices are HARD @gaythu_rajan / @al94781#harnessing_ddd
  13. 13. “Getting service boundaries wrong can result in having to make lots of changes in service-service collaboration. An expensive operation.” from Sam Newman, “Building Microservices” (section: When shouldn’t you use Microservices) Boundaries are HARDEST @gaythu_rajan / @al94781#harnessing_ddd
  14. 14. Microservices LOVE DDD cc: {AndreaRenee} - https://www.flickr.com/photos/30282864@N02 “Despite the hype [microservices] probably giv[e] us the best environment we have ever had for doing Domain-Driven Design” (Interview with Eric Evans at 2015 DDD Exchange) @gaythu_rajan / @al94781#harnessing_ddd
  15. 15. cc: taberandrew - https://www.flickr.com/photos/88442983@N00 @gaythu_rajan / @al94781#harnessing_ddd Unfortunately...
  16. 16. Some steps... @gaythu_rajan / @al94781#harnessing_ddd cc: marsupium photography - https://www.flickr.com/photos/43405950@N07
  17. 17. The Core How DDD helps our CODE cc: Laurence Vagner - https://www.flickr.com/photos/86078191@N00 @gaythu_rajan / @al94781#harnessing_ddd
  18. 18. Ubiquitous Language cc: mag3737 - https://www.flickr.com/photos/50318388@N00 @gaythu_rajan / @al94781#harnessing_ddd
  19. 19. Hands-On Modellers cc: jovike - https://www.flickr.com/photos/49503078599@N01 @gaythu_rajan / @al94781#harnessing_ddd
  20. 20. The Misapplied How DDD helps our overall Architecture cc: juhansonin - https://www.flickr.com/photos/38869431@N00 @gaythu_rajan / @al94781#harnessing_ddd
  21. 21. The Important Bits • Models • Aggregates • Contexts • Bounded Contexts • Context Maps @gaythu_rajan / @al94781#harnessing_ddd
  22. 22. Shared Payment Services Our Case Study: cc: Khánh Hmoong - https://www.flickr.com/photos/7997148@N05 @gaythu_rajan / @al94781#harnessing_ddd
  23. 23. Shared Payment Services @gaythu_rajan / @al94781#harnessing_ddd
  24. 24. @gaythu_rajan / @al94781#harnessing_ddd Shared Payment Services
  25. 25. @gaythu_rajan / @al94781#harnessing_ddd Shared Payment Services
  26. 26. @gaythu_rajan / @al94781#harnessing_ddd Shared Payment Services
  27. 27. Models cc: Rob Swatski - https://www.flickr.com/photos/50946274@N02 @gaythu_rajan / @al94781#harnessing_ddd
  28. 28. @gaythu_rajan / @al94781#harnessing_ddd
  29. 29. @gaythu_rajan / @al94781#harnessing_ddd
  30. 30. @gaythu_rajan / @al94781#harnessing_ddd
  31. 31. @gaythu_rajan / @al94781#harnessing_ddd
  32. 32. @gaythu_rajan / @al94781#harnessing_ddd
  33. 33. @gaythu_rajan / @al94781#harnessing_ddd
  34. 34. Aggregates cc: J-W Brown - https://www.flickr.com/photos/13797487@N00 @gaythu_rajan / @al94781#harnessing_ddd
  35. 35. @gaythu_rajan / @al94781#harnessing_ddd
  36. 36. Contexts cc: petitshoo - https://www.flickr.com/photos/29426084@N00 @gaythu_rajan / @al94781#harnessing_ddd
  37. 37. @gaythu_rajan / @al94781#harnessing_ddd
  38. 38. @gaythu_rajan / @al94781#harnessing_ddd
  39. 39. Bounded Contexts cc: bryce_edwards - https://www.flickr.com/photos/98185064@N00 @gaythu_rajan / @al94781#harnessing_ddd
  40. 40. @gaythu_rajan / @al94781#harnessing_ddd
  41. 41. @gaythu_rajan / @al94781#harnessing_ddd
  42. 42. Context Maps cc: roger4336 - https://www.flickr.com/photos/24736216@N07 @gaythu_rajan / @al94781#harnessing_ddd
  43. 43. @gaythu_rajan / @al94781#harnessing_ddd
  44. 44. Why Aggregates? @gaythu_rajan / @al94781#harnessing_ddd
  45. 45. @gaythu_rajan / @al94781#harnessing_ddd Aggregate == Microservice
  46. 46. @gaythu_rajan / @al94781#harnessing_ddd Aggregate == Microservice
  47. 47. But, Aggregate != Microservice (not always) @gaythu_rajan / @al94781#harnessing_ddd
  48. 48. @gaythu_rajan / @al94781#harnessing_ddd But, Aggregate != Microservice (not always)
  49. 49. @gaythu_rajan / @al94781#harnessing_ddd
  50. 50. 1. Draw a Model and begin to implement it cc: Muffet - https://www.flickr.com/photos/53133240@N00 An Approach @gaythu_rajan / @al94781#harnessing_ddd
  51. 51. 1. Draw a Model and begin to implement it 2. As you draw it and code it, listen to the Language and cultivate your Model accordingly cc: Muffet - https://www.flickr.com/photos/53133240@N00 An Approach @gaythu_rajan / @al94781#harnessing_ddd
  52. 52. 1. Draw a Model and begin to implement it 2. As you draw it and code it, listen to the Language and cultivate your Model accordingly 3. Identify your Aggregates - these are your starter Microservices cc: Muffet - https://www.flickr.com/photos/53133240@N00 An Approach @gaythu_rajan / @al94781#harnessing_ddd
  53. 53. cc: Muffet - https://www.flickr.com/photos/53133240@N00 An Approach @gaythu_rajan / @al94781#harnessing_ddd 1. Draw a Model and begin to implement it 2. As you draw it and code it, listen to the Language and cultivate your Model accordingly 3. Identify your Aggregates - these are your starter Microservices 4. When you hit pain points (indicated by the Language) split into different Bounded Contexts to resolve
  54. 54. 1. Draw a Model and begin to implement it 2. As you draw it and code it, listen to the Language and cultivate your Model accordingly 3. Identify your Aggregates - these are your starter Microservices 4. When you hit pain points (indicated by the Language) split into different Bounded Contexts to resolve 5. Revisit your Bounded Contexts now you know more about how each Aggregate - you may end up splitting them cc: Muffet - https://www.flickr.com/photos/53133240@N00 An Approach @gaythu_rajan / @al94781#harnessing_ddd
  55. 55. Done? cc: WarzauWynn - https://www.flickr.com/photos/94246031@N00 @gaythu_rajan / @al94781#harnessing_ddd
  56. 56. The Ignored How DDD helps our Teams Organise cc: aha42 | tehaha - https://www.flickr.com/photos/31549162@N05 @gaythu_rajan / @al94781#harnessing_ddd
  57. 57. @gaythu_rajan / @al94781#harnessing_ddd Customer-Supplier Partnership Anti-Corruption Layer Upstream Downstream
  58. 58. Shared Kernel Separate Ways Anti- Corruption Layer Partner- ship Conform- ist Open Host Service Customer / Supplier ControlOverAssociatedTeams Communications Commitment / Capability of Teams @gaythu_rajan / @al94781#harnessing_ddd
  59. 59. Shared Kernel Separate Ways Anti- Corruption Layer Partner- ship Conform- ist Open Host Service Customer / Supplier ControlOverAssociatedTeams Communications Commitment / Capability of Teams @gaythu_rajan / @al94781#harnessing_ddd
  60. 60. Shared Kernel Separate Ways Anti- Corruption Layer Partner- ship Conform- ist Open Host Service Customer / Supplier ControlOverAssociatedTeams Communications Commitment / Capability of Teams @gaythu_rajan / @al94781#harnessing_ddd
  61. 61. Upstream/Downstream cc: archer10 (Dennis) (73M Views) - https://www.flickr.com/photos/22490717@N02 @gaythu_rajan / @al94781#harnessing_ddd
  62. 62. Partnership cc: practicalowl - https://www.flickr.com/photos/55046645@N00 @gaythu_rajan / @al94781#harnessing_ddd
  63. 63. @gaythu_rajan / @al94781#harnessing_ddd Partnership
  64. 64. @gaythu_rajan / @al94781#harnessing_ddd
  65. 65. Customer-Supplier cc: TheeErin - https://www.flickr.com/photos/27073477@N00 @gaythu_rajan / @al94781#harnessing_ddd
  66. 66. @gaythu_rajan / @al94781#harnessing_ddd Customer-Supplier
  67. 67. @gaythu_rajan / @al94781#harnessing_ddd @gaythu_rajan / @al94781#harnessing_ddd
  68. 68. Anti-Corruption Layer @gaythu_rajan / @al94781#harnessing_ddd
  69. 69. @gaythu_rajan / @al94781#harnessing_ddd Anti-Corruption Layer Upstream Downstream
  70. 70. @gaythu_rajan / @al94781#harnessing_ddd
  71. 71. Done Done cc: jayneandd - https://www.flickr.com/photos/8180853@N07 @gaythu_rajan / @al94781#harnessing_ddd
  72. 72. Take Home Messages cc: Manoj Kengudelu - https://www.flickr.com/photos/11767573@N02 • Find the right Microservices - or you’ll pine for the Monolith @gaythu_rajan / @al94781#harnessing_ddd
  73. 73. Take Home Messages cc: Manoj Kengudelu - https://www.flickr.com/photos/11767573@N02 • Find the right Microservices - or you’ll pine for the Monolith • Don’t get confused about BCs - they will fall out if you listen to the Language @gaythu_rajan / @al94781#harnessing_ddd
  74. 74. Take Home Messages • Find the right Microservices - or you’ll pine for the Monolith • Don’t get confused about BCs - they will fall out if you listen to the Language • Organise around your services better - apply the Strategic Patterns cc: Manoj Kengudelu - https://www.flickr.com/photos/11767573@N02 @gaythu_rajan / @al94781#harnessing_ddd
  75. 75. Take Home Messages • Find the right Microservices - or you’ll pine for the Monolith • Don’t get confused about BCs - they will fall out if you listen to the Language • Organise around your services better - apply the Strategic Patterns • Be inspired to do more Domain Driven Design cc: Manoj Kengudelu - https://www.flickr.com/photos/11767573@N02 @gaythu_rajan / @al94781#harnessing_ddd
  76. 76. And Finally... cc: oatsy40 - https://www.flickr.com/photos/68089229@N06 @gaythu_rajan / @al94781#harnessing_ddd
  77. 77. Questions Please cc: Derek Bridges - https://www.flickr.com/photos/84949728@N00 @gaythu_rajan / @al94781#harnessing_ddd
  78. 78. Oh, and we (Capgemini ) are hiring! (visit bit.ly/cg-jvm-jobs-ddd) cc: ptrlx - https://www.flickr.com/photos/58615912@N05 @gaythu_rajan / @al94781#harnessing_ddd
  79. 79. Read More... • https://capgemini.github.io/architecture/ microservices-reality-check/ • https://capgemini.github.io/architecture/ why-microservices-are-right-for-us-pt1/ • https://capgemini.github.io/architecture/ microservices-like-change/ • https://capgemini.github.io/architecture/ microservices-gotchas/ cc: Manoj Kengudelu - https://www.flickr.com/photos/11767573@N02 @gaythu_rajan / @al94781#harnessing_ddd

×