Strategischer Anwendungsentwurf mit Domain-Driven Design

628
-1

Published on

Presented at dotnet-zentral.ch on March 18th 2013 by Dennis Traub

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
628
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Strategischer Anwendungsentwurf mit Domain-Driven Design

  1. 1. Strategischer Anwendungsentwurf mit Domain-Driven Design presented by Dennis Traub .NET Usergroup Zentralschweiz - 18. März 2013Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  2. 2. Now, who‘s that guy? Dennis Traub Founder, Owner, CEO, Single Employee of D. Traub Software Development Consultancy Consultant, developer, trainer, speaker 39 years old Married, father of one 20+ years in software development Hire me at mail@dennistraub.de @dtraubDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  3. 3. AGENDAThe Blue Book An Example Break Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  4. 4. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  5. 5. The „Blue Book“ by Eric Evans Image PlaceholderDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  6. 6. The „Blue Book“ by Eric Evans • Entities • Value Objects Tactical • Aggregates Class • Repositories Design • Services • Factories • etc. It should be two books! • Model Integrity • Large-Scale Structure • Bounded Contexts Strategic • Core Domain DDD • Context Maps • Ubiquitous Language • etc.Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  7. 7. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  8. 8. DomainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  9. 9. Domain a sphere of knowledge, influence, or activityDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  10. 10. Domain what an organization does and the world it does it inDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  11. 11. Domain ModelDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  12. 12. Domain Model a system of abstractions that describes selected aspects of a domainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  13. 13. Domain Model can be used to solve problems related to that domainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  14. 14. don‘t model realityDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  15. 15. we model useful abstractions of realityDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  16. 16. Ubiquitous LanguageDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  17. 17. Ubiquitous Language a language structured around the domain modelDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  18. 18. Ubiquitous Language used by all team membersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  19. 19. Bounded ContextDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  20. 20. Bounded Context an explicit boundary within which a domain model existsDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  21. 21. Bounded Context inside the boundary all terms have specific meaningDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  22. 22. Bounded Context these terms are part of the context‘s ubiquitous languageDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  23. 23. SubdomainsDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  24. 24. Subdomains the whole domain of the organization is comprised of subdomainsDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  25. 25. Subdomains they focus on only one specific area of the whole business domainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  26. 26. Core DomainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  27. 27. Core Domain the distinctive part of the model, central to the users‘ goalsDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  28. 28. Core Domain differentiates the application and makes it valuableDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  29. 29. Core Domain the most important subdomainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  30. 30. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  31. 31. Our Domain:Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  32. 32. AviationDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  33. 33. Our Application:Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  34. 34. Ambulance Flight ManagementDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  35. 35. Ambulance Flight Management order flights from an operator dispatch patients assign medical staffDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  36. 36. Bounded Contexts 1 Patiententransport-Disposition 2 Flugplanung und -durchführung 3 Personaleinsatzplanung (Flugärzte, Rettungsassistenten) 4 Patientendaten, Abrechnung, Buchhaltung 5 SOAP- oder REST-Services, Web-OberflächeDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  37. 37. Subdomains 1 Ambulanzflug-Disposition 6 Bodentransport 2 Flotten-Management 7 Abrechnung, Buchhaltung 3 Flugplanung 8 Anwendungsoberfläche 4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle 5 Medizinisches Personal 10 Benutzer- und ZugriffssteuerungDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  38. 38. don‘t build a model that works for everyoneDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  39. 39. to focus our effort and resources we ask two questions for each subdomainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  40. 40. 1 how complex is it?Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  41. 41. 2 what‘s the value to our specific problem? (if we model it ourselves)Dennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  42. 42. 1. Complexity (S/M/H) 1 Ambulanzflug-Disposition 6 Bodentransport 2 Flotten-Management 7 Abrechnung, Buchhaltung 3 Flugplanung 8 Anwendungsoberfläche 4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle 5 Medizinisches Personal 10 Benutzer- und ZugriffssteuerungDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  43. 43. 2. Value (S/M/H) 1 Ambulanzflug-Disposition 6 Bodentransport 2 Flotten-Management 7 Abrechnung, Buchhaltung 3 Flugplanung 8 Anwendungsoberfläche 4 Passagier-/Patientendaten 9 SOAP-/REST-Schnittstelle 5 Medizinisches Personal 10 Benutzer- und ZugriffssteuerungDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  44. 44. the tactical Building Blocks we don‘t use DDD when there is no value in formalizing the problemDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  45. 45. we only use DDD in parts where we get a competitive advantageDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  46. 46. 15 minutes BREAKDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  47. 47. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  48. 48. Presentation Layer Common Services Infrastructure Application Services Domain / Business Model / BLL DAL / O/R-MapperDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  49. 49. Ports & Adapters Hexagonal Architecture Onion ArchitectureDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  50. 50. Dependency Inversion Principle (just in case) the D in SOLIDDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  51. 51. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  52. 52. EntityDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  53. 53. Entity an object primarily defined by its identityDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  54. 54. Entity has a life cycle that can radically change its form and contentDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  55. 55. Value ObjectDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  56. 56. Value Object an object that represents a descriptive aspect of the domainDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  57. 57. Value Object doesn‘t have a distinct identity treated as immutableDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  58. 58. AggregateDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  59. 59. Aggregate a cluster of associated objectsDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  60. 60. Aggregate treated as a unit for the purpose of data changesDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  61. 61. Aggregate a set of consistency rules applies within the aggregate‘s boundariesDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  62. 62. Aggregate enforces its own invariants and is always in a valid stateDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  63. 63. AGENDAThe Blue Book An Example Tactical Patterns Actually it should Bounded Contexts A short review of be two books! and Subdomains the Building Blocks 1 2 3 4 5 6 Terminology Lasagna End of Strategic Design … the new Spaghetti Questions & AnswersDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  64. 64. To summarize: DDD is basically the application of the SOLID principles of object-orientation on an architectural levelDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  65. 65. ? QUESTIONSDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de
  66. 66. THANK YOU! follow me: @dtraubDennis Traub – Software Development Consultancy @dtraub – mail@dennistraub.de

×