Thursday, March 1, 2012
Domain Driven Designshort RefresherFLOW3 Usergroup @AOEby Daniel PötzingerThursday, March 1, 2012
Thursday, March 1, 2012
The problem that we want tosolveThursday, March 1, 2012
The problemThursday, March 1, 2012
‣ We need to write an application that solvesbuissiness problemsThe problemThursday, March 1, 2012
‣ We need to write an application that solvesbuissiness problems‣ We want to use OOPThe problemThursday, March 1, 2012
‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:The pro...
‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ under...
‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ under...
‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ under...
Thursday, March 1, 2012
Domain Model ?Thursday, March 1, 2012
Domain Model ?Thursday, March 1, 2012
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelThursday, March 1, 2012
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsThursday, March 1,...
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsThur...
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsThur...
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsKnow...
‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsKnow...
‣ a common language should be used to describe theproblemDomain ModelDomain ModelDomain ExpertsImplementatorsUbiquitousDom...
‣ a common language should be used to describe theproblemDomain ModelDomain ModelDomain ExpertsImplementatorsUbiquitousDom...
‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelThursday, March 1, 2012
‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextA customer can have multiple co...
‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextUMLA customer can have multiple...
‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextUMLA customer can have multiple...
Thursday, March 1, 2012
UMLThursday, March 1, 2012
•UML is perfect to describe, scetch or discuss a domainmodel.UMLUMLStructural Diagrams Behavioral DiagramsClass Diagrams O...
UML - Class DiagramThursday, March 1, 2012
‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.UML - Cla...
‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.‣ Can be ...
‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.‣ Can be ...
‣ classes with:‣ attributes (<name>:<type> )‣ methods‣ annotations and properties‣ Associations‣ Multiplicity, roles‣ Trav...
‣ Depend on class diagrams‣ „Snapshot“ of instances and theire relations‣ Perfect to understand object behaviour and their...
‣ Depend on class diagrams‣ Perfect to explain how objects work together to„fulfill“ a use-case.‣ useful to detect weakness...
Thursday, March 1, 2012
Domain Driven DesignBasicsThursday, March 1, 2012
1. Layered Architecture2. Common Building Blocks and Rules3. Find a „supple design“4. See the big pictureDomain Driven Des...
DDD - Layered ArchitectureThursday, March 1, 2012
DDD - Layered ArchitectureInfrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsThursday, March 1, 2012
DDD - Layered ArchitectureDomain ModelInfrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsCore Busi...
DDD - Layered ArchitectureDomain ModelApplication Layer (thin)Infrastructure / SystemLoggingPersitenceSpeaking to Webservi...
DDD - Layered ArchitectureDomain ModelApplication Layer (thin)Infrastructure / SystemLoggingPersitenceSpeaking to Webservi...
DDD - Layered ArchitectureDomain ModelApplication Layer (thin)ViewInfrastructure / SystemLoggingPersitenceSpeaking to Webs...
Thursday, March 1, 2012
Building BlocksThursday, March 1, 2012
Building BlocksThursday, March 1, 2012
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksEntitiesThursday, March 1, 2012
DDD - Building BlocksEntitiesValuesThursday, March 1, 2012
DDD - Building BlocksEntitiesValuesServicesThursday, March 1, 2012
DDD - Building BlocksEntitiesValuesServicesRepositoryThursday, March 1, 2012
DDD - Building BlocksEntitiesValuesServicesRepositoryFactoryThursday, March 1, 2012
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksEntitiesThursday, March 1, 2012
DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car...
DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car...
DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car...
DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car...
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksValueThursday, March 1, 2012
DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not...
DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not...
DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not...
DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not...
DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not...
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksServiceThursday, March 1, 2012
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entit...
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksRepositoryThursday, March 1, 2012
DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the...
DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the...
DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the...
DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the...
DDD - Building BlocksThursday, March 1, 2012
DDD - Building BlocksFactoryThursday, March 1, 2012
DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!Thursda...
DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomi...
DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomi...
DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomi...
DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomi...
Thursday, March 1, 2012
Find a Supple DesignThursday, March 1, 2012
Find a Supple Designvs.Thursday, March 1, 2012
Supple Design „Speak in Domain Language“Thursday, March 1, 2012
‣ Try to explain scenarios loud with the use of the modeland the ubiquitous languageSupple Design „Speak in Domain Languag...
‣ Try to explain scenarios loud with the use of the modeland the ubiquitous language‣ Try to explain scenarios more simple...
Supple Design „Reduce Associations“Thursday, March 1, 2012
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!Supple Design „Reduce As...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of b...
Supple Design - AggregatesThursday, March 1, 2012
Supple Design - Aggregates‣ An aggregate is a group of objects that belong together(a group of individual objects that rep...
Supple Design - Aggregates‣ An aggregate is a group of objects that belong together(a group of individual objects that rep...
Supple Design - „Explicit constrains“Thursday, March 1, 2012
Supple Design - „Explicit constrains“‣ name and make constrains explicit.That gives it a nameyou can talk about and the co...
Supple Design - „Explicit constrains“‣ name and make constrains explicit.That gives it a nameyou can talk about and the co...
Supple Design - „Specifications“Thursday, March 1, 2012
Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesThursday, March 1, 2012
Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:Thursday, March 1, 2012
Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:„InventoryDelinquentSpecifi...
Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:„InventoryDelinquentSpecifi...
Supple Design - ModulesIf your model tells a story a module is a chapterThursday, March 1, 2012
Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaidThursday, March ...
Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaid• group by meani...
Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaid• group by meani...
Supple Design - What elseThursday, March 1, 2012
Supple Design - What else• Intention Revalving InterfacesThursday, March 1, 2012
Supple Design - What else• Intention Revalving Interfaces• standalone classes where possibleThursday, March 1, 2012
Supple Design - What else• Intention Revalving Interfaces• standalone classes where possible• closure of operationsThursda...
Supple Design - What else• Intention Revalving Interfaces• standalone classes where possible• closure of operations• side ...
Thank you for great year!Thursday, March 1, 2012
Thank you for great year!ThanksThursday, March 1, 2012
Upcoming SlideShare
Loading in...5
×

Domain Driven Design

766

Published on

Mar 01, 2012

Short Domain Driven Design and UML Refresher

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

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

No notes for slide

Domain Driven Design

  1. 1. Thursday, March 1, 2012
  2. 2. Domain Driven Designshort RefresherFLOW3 Usergroup @AOEby Daniel PötzingerThursday, March 1, 2012
  3. 3. Thursday, March 1, 2012
  4. 4. The problem that we want tosolveThursday, March 1, 2012
  5. 5. The problemThursday, March 1, 2012
  6. 6. ‣ We need to write an application that solvesbuissiness problemsThe problemThursday, March 1, 2012
  7. 7. ‣ We need to write an application that solvesbuissiness problems‣ We want to use OOPThe problemThursday, March 1, 2012
  8. 8. ‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:The problemThursday, March 1, 2012
  9. 9. ‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ understanding the problem and the buissinessThe problemThursday, March 1, 2012
  10. 10. ‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ understanding the problem and the buissiness‣ find understandable class-structureThe problemThursday, March 1, 2012
  11. 11. ‣ We need to write an application that solvesbuissiness problems‣ We want to use OOP‣ We need to find a good design:‣ understanding the problem and the buissiness‣ find understandable class-structure‣ build maintainable software, that can be adjustedeasy when the buissiness changesThe problemThursday, March 1, 2012
  12. 12. Thursday, March 1, 2012
  13. 13. Domain Model ?Thursday, March 1, 2012
  14. 14. Domain Model ?Thursday, March 1, 2012
  15. 15. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelThursday, March 1, 2012
  16. 16. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsThursday, March 1, 2012
  17. 17. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsThursday, March 1, 2012
  18. 18. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsThursday, March 1, 2012
  19. 19. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsKnowledge Crunching& AnalysisThursday, March 1, 2012
  20. 20. ‣ The domain model offers a simplified, abstract view ofthe problemDomain ModelDomain ModelDomain ExpertsImplementatorsKnowledge Crunching& AnalysisThursday, March 1, 2012
  21. 21. ‣ a common language should be used to describe theproblemDomain ModelDomain ModelDomain ExpertsImplementatorsUbiquitousDomain LanguageUses termsBoth understandThursday, March 1, 2012
  22. 22. ‣ a common language should be used to describe theproblemDomain ModelDomain ModelDomain ExpertsImplementatorsUbiquitousDomain LanguageUses termsBoth understandThursday, March 1, 2012
  23. 23. ‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelThursday, March 1, 2012
  24. 24. ‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextA customer can have multiple contracts.The customer gets monthly bills to hisbilling address.Thursday, March 1, 2012
  25. 25. ‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextUMLA customer can have multiple contracts.The customer gets monthly bills to hisbilling address.Thursday, March 1, 2012
  26. 26. ‣ The Domain Model can be represented as Text, Speechor Code...Domain ModelDomain ModelTextUMLA customer can have multiple contracts.The customer gets monthly bills to hisbilling address.CodeThursday, March 1, 2012
  27. 27. Thursday, March 1, 2012
  28. 28. UMLThursday, March 1, 2012
  29. 29. •UML is perfect to describe, scetch or discuss a domainmodel.UMLUMLStructural Diagrams Behavioral DiagramsClass Diagrams Object Diagrams Sequence Diagrams Use Case Diagram ......Thursday, March 1, 2012
  30. 30. UML - Class DiagramThursday, March 1, 2012
  31. 31. ‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.UML - Class DiagramThursday, March 1, 2012
  32. 32. ‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.‣ Can be directly mapped to code (OOP)UML - Class DiagramThursday, March 1, 2012
  33. 33. ‣ class diagram describes the attributes and operations ofa class and also the constraints imposed on the system.‣ Can be directly mapped to code (OOP)‣ Popular use-case is to explain conceptual importantparts => keep it simple („draw it on a paper“)UML - Class DiagramThursday, March 1, 2012
  34. 34. ‣ classes with:‣ attributes (<name>:<type> )‣ methods‣ annotations and properties‣ Associations‣ Multiplicity, roles‣ Traversal‣ Aggregation, Composition‣ Inheritance, Dependency‣ Qualifier‣ Association ClassUML - Class Diagram - ExamplesThursday, March 1, 2012
  35. 35. ‣ Depend on class diagrams‣ „Snapshot“ of instances and theire relations‣ Perfect to understand object behaviour and theirrelationship from practical perspectiveUML - Object DiagramThursday, March 1, 2012
  36. 36. ‣ Depend on class diagrams‣ Perfect to explain how objects work together to„fulfill“ a use-case.‣ useful to detect weakness and improvements in yourdesignUML - Sequence DiagramThursday, March 1, 2012
  37. 37. Thursday, March 1, 2012
  38. 38. Domain Driven DesignBasicsThursday, March 1, 2012
  39. 39. 1. Layered Architecture2. Common Building Blocks and Rules3. Find a „supple design“4. See the big pictureDomain Driven Design - BasicsThursday, March 1, 2012
  40. 40. DDD - Layered ArchitectureThursday, March 1, 2012
  41. 41. DDD - Layered ArchitectureInfrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsThursday, March 1, 2012
  42. 42. DDD - Layered ArchitectureDomain ModelInfrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsCore Business LogicThursday, March 1, 2012
  43. 43. DDD - Layered ArchitectureDomain ModelApplication Layer (thin)Infrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsCore Business LogicController / (Export/Import)Thursday, March 1, 2012
  44. 44. DDD - Layered ArchitectureDomain ModelApplication Layer (thin)Infrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsCore Business LogicController / (Export/Import)User /Other AppsThursday, March 1, 2012
  45. 45. DDD - Layered ArchitectureDomain ModelApplication Layer (thin)ViewInfrastructure / SystemLoggingPersitenceSpeaking to WebservicesFile FormatsCore Business LogicController / (Export/Import)Templates / Presentation ObjectsUser /Other AppsThursday, March 1, 2012
  46. 46. Thursday, March 1, 2012
  47. 47. Building BlocksThursday, March 1, 2012
  48. 48. Building BlocksThursday, March 1, 2012
  49. 49. DDD - Building BlocksThursday, March 1, 2012
  50. 50. DDD - Building BlocksEntitiesThursday, March 1, 2012
  51. 51. DDD - Building BlocksEntitiesValuesThursday, March 1, 2012
  52. 52. DDD - Building BlocksEntitiesValuesServicesThursday, March 1, 2012
  53. 53. DDD - Building BlocksEntitiesValuesServicesRepositoryThursday, March 1, 2012
  54. 54. DDD - Building BlocksEntitiesValuesServicesRepositoryFactoryThursday, March 1, 2012
  55. 55. DDD - Building BlocksThursday, March 1, 2012
  56. 56. DDD - Building BlocksEntitiesThursday, March 1, 2012
  57. 57. DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car", "Costumer" or"BankTransaction".Thursday, March 1, 2012
  58. 58. DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car", "Costumer" or"BankTransaction".• often has some ID valueThursday, March 1, 2012
  59. 59. DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car", "Costumer" or"BankTransaction".• often has some ID value• continuity through livecycleThursday, March 1, 2012
  60. 60. DDD - Building BlocksEntitiesObject which is primary defined by its identity (not byattributes). For example "Person", "Car", "Costumer" or"BankTransaction".• often has some ID value• continuity through livecycle• keep class definition simple / focus on live cycleThursday, March 1, 2012
  61. 61. DDD - Building BlocksThursday, March 1, 2012
  62. 62. DDD - Building BlocksValueThursday, March 1, 2012
  63. 63. DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not who) Example:address, color ...Thursday, March 1, 2012
  64. 64. DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not who) Example:address, color ...• should represent a whole value (conceptual thing )Thursday, March 1, 2012
  65. 65. DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not who) Example:address, color ...• should represent a whole value (conceptual thing )• Often passed as argumentsThursday, March 1, 2012
  66. 66. DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not who) Example:address, color ...• should represent a whole value (conceptual thing )• Often passed as arguments• No Identity gives freedomThursday, March 1, 2012
  67. 67. DDD - Building BlocksValuedescribe the characteristic of a thing and identity is notrequired. (We care what they are - not who) Example:address, color ...• should represent a whole value (conceptual thing )• Often passed as arguments• No Identity gives freedom• should be Immutable!Thursday, March 1, 2012
  68. 68. DDD - Building BlocksThursday, March 1, 2012
  69. 69. DDD - Building BlocksServiceThursday, March 1, 2012
  70. 70. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."Thursday, March 1, 2012
  71. 71. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."• statelessThursday, March 1, 2012
  72. 72. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."• stateless• offer a useful service or action and deals with other domainobjectsThursday, March 1, 2012
  73. 73. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."• stateless• offer a useful service or action and deals with other domainobjects• defined in common domain languageThursday, March 1, 2012
  74. 74. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."• stateless• offer a useful service or action and deals with other domainobjects• defined in common domain language• do not mix with other layersThursday, March 1, 2012
  75. 75. DDD - Building BlocksService“...if a single process or transformation in domain is not anatural responsibility of an entity or value => make it astandalone service with a nice interface."• stateless• offer a useful service or action and deals with other domainobjects• defined in common domain language• do not mix with other layersExamples: FundTransferService / PackageRoutingService / SimCardActivationServiceThursday, March 1, 2012
  76. 76. DDD - Building BlocksThursday, March 1, 2012
  77. 77. DDD - Building BlocksRepositoryThursday, March 1, 2012
  78. 78. DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the illusion of an inmemory collection of all objects of that type. Setupaccess through a well knows global interface.Thursday, March 1, 2012
  79. 79. DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the illusion of an inmemory collection of all objects of that type. Setupaccess through a well knows global interface.• typicaly methods for add() remove() and find*()Thursday, March 1, 2012
  80. 80. DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the illusion of an inmemory collection of all objects of that type. Setupaccess through a well knows global interface.• typicaly methods for add() remove() and find*()•find* methods communicate design decisions about how toaccess the dataThursday, March 1, 2012
  81. 81. DDD - Building BlocksRepositoryFor each object where you need global access create arepository object that can provide the illusion of an inmemory collection of all objects of that type. Setupaccess through a well knows global interface.• typicaly methods for add() remove() and find*()•find* methods communicate design decisions about how toaccess the data• ..reconstitution?Thursday, March 1, 2012
  82. 82. DDD - Building BlocksThursday, March 1, 2012
  83. 83. DDD - Building BlocksFactoryThursday, March 1, 2012
  84. 84. DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!Thursday, March 1, 2012
  85. 85. DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomic (need to pass all essential parameters)Thursday, March 1, 2012
  86. 86. DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomic (need to pass all essential parameters)• not allowed to give wrong results (exceptions)Thursday, March 1, 2012
  87. 87. DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomic (need to pass all essential parameters)• not allowed to give wrong results (exceptions)• entity vs. value factoriesThursday, March 1, 2012
  88. 88. DDD - Building BlocksFactoryA factory hides logic for building objects - this isespecially relevant for aggregates!• atomic (need to pass all essential parameters)• not allowed to give wrong results (exceptions)• entity vs. value factories• (can also be used for reconstitution )Thursday, March 1, 2012
  89. 89. Thursday, March 1, 2012
  90. 90. Find a Supple DesignThursday, March 1, 2012
  91. 91. Find a Supple Designvs.Thursday, March 1, 2012
  92. 92. Supple Design „Speak in Domain Language“Thursday, March 1, 2012
  93. 93. ‣ Try to explain scenarios loud with the use of the modeland the ubiquitous languageSupple Design „Speak in Domain Language“Thursday, March 1, 2012
  94. 94. ‣ Try to explain scenarios loud with the use of the modeland the ubiquitous language‣ Try to explain scenarios more simple/better (find easierways to say what you need to say).=> That helps refining the model.Supple Design „Speak in Domain Language“Thursday, March 1, 2012
  95. 95. Supple Design „Reduce Associations“Thursday, March 1, 2012
  96. 96. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!Supple Design „Reduce Associations“Thursday, March 1, 2012
  97. 97. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectionalSupple Design „Reduce Associations“Thursday, March 1, 2012
  98. 98. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectional‣ adding qualifier to reduce multiplicity (class missing?)Supple Design „Reduce Associations“Thursday, March 1, 2012
  99. 99. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectional‣ adding qualifier to reduce multiplicity (class missing?)‣ eliminate non essential assoc.Supple Design „Reduce Associations“Thursday, March 1, 2012
  100. 100. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectional‣ adding qualifier to reduce multiplicity (class missing?)‣ eliminate non essential assoc.‣ find and use aggregatesSupple Design „Reduce Associations“Thursday, March 1, 2012
  101. 101. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectional‣ adding qualifier to reduce multiplicity (class missing?)‣ eliminate non essential assoc.‣ find and use aggregates=> Intuition and RefactoringSupple Design „Reduce Associations“Thursday, March 1, 2012
  102. 102. ‣ Avoid many association and use only a minimum ofrelations because they decrease maintainability!‣ traversal instead of bidirectional‣ adding qualifier to reduce multiplicity (class missing?)‣ eliminate non essential assoc.‣ find and use aggregates=> Intuition and Refactoring... country / president example ...Supple Design „Reduce Associations“Thursday, March 1, 2012
  103. 103. Supple Design - AggregatesThursday, March 1, 2012
  104. 104. Supple Design - Aggregates‣ An aggregate is a group of objects that belong together(a group of individual objects that represents a unit)Thursday, March 1, 2012
  105. 105. Supple Design - Aggregates‣ An aggregate is a group of objects that belong together(a group of individual objects that represents a unit)‣ ...car example... (root, boundary, invariants )Thursday, March 1, 2012
  106. 106. Supple Design - „Explicit constrains“Thursday, March 1, 2012
  107. 107. Supple Design - „Explicit constrains“‣ name and make constrains explicit.That gives it a nameyou can talk about and the code is moreunderstandableThursday, March 1, 2012
  108. 108. Supple Design - „Explicit constrains“‣ name and make constrains explicit.That gives it a nameyou can talk about and the code is moreunderstandableBucket exampleThursday, March 1, 2012
  109. 109. Supple Design - „Specifications“Thursday, March 1, 2012
  110. 110. Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesThursday, March 1, 2012
  111. 111. Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:Thursday, March 1, 2012
  112. 112. Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:„InventoryDelinquentSpecification“->isSatisfied()Thursday, March 1, 2012
  113. 113. Supple Design - „Specifications“‣ you can use „Specifications“ to explicit express rulesexamples:„InventoryDelinquentSpecification“->isSatisfied()„GoldenCustomerSpecification“->isSatisfied($customer)Thursday, March 1, 2012
  114. 114. Supple Design - ModulesIf your model tells a story a module is a chapterThursday, March 1, 2012
  115. 115. Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaidThursday, March 1, 2012
  116. 116. Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaid• group by meaning in the domainThursday, March 1, 2012
  117. 117. Supple Design - ModulesCustomer OrderProductCustomer Contract Basket OrderOrderItemsAbstractProductPrepaid• group by meaning in the domain• loose coupling between modulesThursday, March 1, 2012
  118. 118. Supple Design - What elseThursday, March 1, 2012
  119. 119. Supple Design - What else• Intention Revalving InterfacesThursday, March 1, 2012
  120. 120. Supple Design - What else• Intention Revalving Interfaces• standalone classes where possibleThursday, March 1, 2012
  121. 121. Supple Design - What else• Intention Revalving Interfaces• standalone classes where possible• closure of operationsThursday, March 1, 2012
  122. 122. Supple Design - What else• Intention Revalving Interfaces• standalone classes where possible• closure of operations• side effect free functionsThursday, March 1, 2012
  123. 123. Thank you for great year!Thursday, March 1, 2012
  124. 124. Thank you for great year!ThanksThursday, March 1, 2012
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×