Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Fractal Geometry of Software Design

The Fractal Geometry of Software Design

Presented at Domain-Driven Design Europe 2022 (Keynote)

B90ab53ba7cf16ed1a4bb679cc6751d7?s=128

Vladik Khononov

June 24, 2022
Tweet

More Decks by Vladik Khononov

Other Decks in Technology

Transcript

  1. vladikk doit-intl.com #DDDEU THE FRACTAL GEOMETRY OF SOFTWARE DESIGN

  2. @vladikk vladikk.com vladik@khononov.com VLADIK (VLAD) 
 KHONONOV

  3. vladikk doit-intl.com #DDDEU

  4. vladikk doit-intl.com #DDDEU • How much food do we need

    to stay alive? • How creative are we? • How profitable are our companies?
  5. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. How much food do we need to stay alive? How creative are we? How profitable are our companies?
  6. vladikk doit-intl.com #DDDEU METABOLIC RATE OF ANIMALS West, G. (2018).

    Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  7. vladikk doit-intl.com #DDDEU REGISTERED PATENTS West, G. (2018). Scale: The

    universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  8. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. INCOME AND ASSETS OF COMPANIES
  9. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. How much food do we need to stay alive? How creative are we? How profitable are our companies?
  10. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. How much food do we need to stay alive? How creative are we? How profitable are our companies?
  11. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  12. vladikk doit-intl.com #DDDEU METABOLIC RATE OF ANIMALS West, G. (2018).

    Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  13. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. How much food do we need to stay alive? How creative are we? How profitable are our companies?
  14. vladikk doit-intl.com #DDDEU "Viewed through this lens, cities, companies, plants,

    animals, our bodies, and even tumors manifest a remarkable similarity in the ways that they are organized and function." - Geo ff rey West
  15. vladikk doit-intl.com #DDDEU

  16. vladikk doit-intl.com #DDDEU AGENDA 1. A primer on energy supply

    networks 2. How network theory applies to software design 3. Leveraging the network theory to manage complexity 4. S ^ D
  17. vladikk doit-intl.com #DDDEU ENERGY SUPPLY 
 NETWORKS

  18. vladikk doit-intl.com #DDDEU ENERGY SUPPLY NETWORKS Systems that are sustained

    by the transport of energy through hierarchical networks.
  19. vladikk doit-intl.com #DDDEU ENERGY SUPPLY NETWORKS

  20. vladikk doit-intl.com #DDDEU ENERGY SUPPLY NETWORKS

  21. vladikk doit-intl.com #DDDEU SOFTWARE DESIGN AS AN ENERGY SUPPLY NETWORK

  22. vladikk doit-intl.com #DDDEU WHAT IS THE ENERGY SUPPLIED BY SOFTWARE

    DESIGN?
  23. vladikk doit-intl.com #DDDEU WHAT IS THE ENERGY SUPPLIED BY SOFTWARE

    DESIGN? — KNOWLEDGE
  24. vladikk doit-intl.com #DDDEU

  25. vladikk doit-intl.com #DDDEU Shared Knowledge Encapsulated 
 Knowledge Boundaries Encapsulated

    
 Knowledge
  26. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling
  27. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling • How the parts of the system are implemented • Private interfaces • Not intended for inter-component integration
  28. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling • Knowledge of what the system has to do • Business logic • Use cases • Rules, invariants, constraints
  29. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling • Models of the business domain • Data structures • Software system-related aspects of the business domain • Understanding of the functional requirements
  30. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling • Components’ integration contracts • Integration-specific models, APIs • The minimal data needed for components to work together
  31. vladikk doit-intl.com #DDDEU “System design is inherently about boundaries (what’s

    in, what’s out, what spans, what moves between), and about tradeo ff s. It reshapes what is outside, just as it shapes what is inside.” - Ruth Malan (@ruthmalan)
  32. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Knowledge

    vs Data: TBs of data across a contract-based interface vs 
 a few bytes across implementation-coupled modules
  33. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN So

    ft ware systems are sustained by the transport of knowledge (energy) through hierarchical networks of modules.
  34. vladikk doit-intl.com #DDDEU ECONOMIES OF SCALE IN 
 ENERGY SUPPLY

    NETWORKS
  35. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  36. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  37. vladikk doit-intl.com #DDDEU METABOLIC RATE OF ANIMALS West, G. (2018).

    Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  38. vladikk doit-intl.com #DDDEU METABOLIC RATE OF ANIMALS West, G. (2018).

    Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  39. vladikk doit-intl.com #DDDEU y = 3.4 * x3/4 West, G.

    (2018). Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  40. vladikk doit-intl.com #DDDEU y = 3.4 * x3/4 y =

    x Sublinear 
 Growth Linear 
 Growth Sublinear function grows slower than any linear function
  41. vladikk doit-intl.com #DDDEU Chihuahua Yorkshire Terrier Pug Beagle Boxer Newfoundland

    1.8kg 3.5kg 7kg 14.5kg 29kg 58kg
  42. vladikk doit-intl.com #DDDEU Chihuahua Yorkshire Terrier Pug Beagle Boxer Newfoundland

    1.8kg 3.5kg 7kg 14.5kg 29kg 58kg BASAL METABOLIC RATE The minimum number of calories a day needed 
 to stay alive without performing any activities. https://www.sciencedirect.com/topics/engineering/basal-metabolic-rate
  43. vladikk doit-intl.com #DDDEU Chihuahua Yorkshire Terrier Pug Beagle Boxer Newfoundland

    1.8kg 3.5kg 7kg 14.5kg 29kg 58kg 110 220 440 880 1,760 3,520 Breed Weight Basal 
 Metabolic 
 Rate
  44. vladikk doit-intl.com #DDDEU Chihuahua Yorkshire Terrier Pug Beagle Boxer Newfoundland

    1.8kg 3.5kg 7kg 14.5kg 29kg 58kg 110 220 440 880 1,760 3,520 110 180 302 521 876 1,474 Breed Weight Linear Thinking Basal 
 Metabolic 
 Rate
  45. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. NO. OF GASOLINE STATIONS
  46. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  47. vladikk doit-intl.com #DDDEU REGISTERED PATENTS West, G. (2018). Scale: The

    universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  48. vladikk doit-intl.com #DDDEU y = x1.15 y = x West,

    G. (2018). Scale: The universal laws of life and death in organisms, cities and companies. Weidenfeld & Nicolson.
  49. vladikk doit-intl.com #DDDEU y = x1.15 y = x Superlinear

    
 Growth Linear 
 Growth Superlinear function grows faster than any linear function
  50. vladikk doit-intl.com #DDDEU ECONOMIES OF SCALE Superlinear 
 Growth Sublinear

    
 Growth Linear 
 Growth
  51. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN So

    ft ware systems are sustained by the transport of knowledge (energy) through hierarchical networks of modules.
  52. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Functionality (Linear growth)

  53. vladikk doit-intl.com #DDDEU ECONOMIES OF SCALE Superlinear 
 Growth Sublinear

    
 Growth Linear 
 Growth
  54. vladikk doit-intl.com #DDDEU ECONOMIES OF SCALE Superlinear 


  55. vladikk doit-intl.com #DDDEU GROWTH LIMITS

  56. vladikk doit-intl.com #DDDEU "You can plainly see the impossibility of

    increasing the size of structures to vast dimensions either in art or in nature; … also it would be impossible to build up the bony structures of men, horses, or other animals so as to hold together and perform their normal functions . . . for if his height be increased inordinately he will fall and be crushed under his own weight.” - Galileo Galilei
  57. vladikk doit-intl.com #DDDEU

  58. vladikk doit-intl.com #DDDEU

  59. vladikk doit-intl.com #DDDEU Cross-section Resistance to fracture is proportional to

    the cross-sectional area
  60. vladikk doit-intl.com #DDDEU x2 x2 x2 Weight increase: Strength increase:

    2 * 2 * 2 = x8 2 * 2 = x4
  61. vladikk doit-intl.com #DDDEU

  62. vladikk doit-intl.com #DDDEU GROWTH LIMITS Superlinear 
 Growth Sublinear 


    Growth Linear 
 Growth • As a system grows, it becomes more efficient • Undesired consequences of growth become more efficient as well
  63. vladikk doit-intl.com #DDDEU ORGANISMS • Limbs are unable to support

    the overall weight • The amount of cells surpasses capillaries’ ability to supply energy • All available energy used for repairing consequences of entropy CITIES • Overcrowding • Crime rates • Pollution • Spread of diseases COMPANIES • Sublinear scaling of sales, incomes, and profits • Bureaucracy • Administration and management complexity SOFTWARE SYSTEMS ?
  64. vladikk doit-intl.com #DDDEU GROWTH LIMITS IN SOFTWARE SYSTEMS

  65. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Functionality (Linear growth)

  66. vladikk doit-intl.com #DDDEU M8 M10 M9 M6 M1 M2 M3

    M4 M5 M7
  67. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth)
  68. vladikk doit-intl.com #DDDEU Knowledge Miller, G. A. (1994). The magical

    number seven, plus or minus two: Some limits on our capacity for processing information. Psychological Review, 101(2), 343–352 ESTIMATED CAPACITY FOR PROCESSING INFORMATION 2000s: 4 +/- 1 Cowan, Nelson. "The magical number 4 in short-term memory: A reconsideration of mental storage capacity." Behavioral and brain sciences 24.1 (2001): 87-114.
  69. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth)
  70. vladikk doit-intl.com #DDDEU Knowledge - Galileo Galilei

  71. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth)
  72. vladikk doit-intl.com #DDDEU EXTENDING GROWTH LIMITS

  73. vladikk doit-intl.com #DDDEU “I have sketched a bone whose natural

    length has been increased three times and whose thickness has been multiplied until, for a correspondingly large animal, it would perform the same function which the small bone performs for its small animal” - Galileo Galilei
  74. vladikk doit-intl.com #DDDEU “if one wishes to maintain in a

    great giant the same proportion of limb as that found in an ordinary man he must find a harder and stronger material for making the bones” - Galileo Galilei
  75. vladikk doit-intl.com #DDDEU POSTPONING GROWTH LIMITS 1. Adapt form /

    shape to withstand increased stress 2. Use stronger materials
  76. vladikk doit-intl.com #DDDEU SUSTAINABLE GROWTH 
 REQUIRES INNOVATION

  77. vladikk doit-intl.com #DDDEU ORGANISMS • Limbs are unable to support

    the overall weight • Crime rates • Pollution • Spread of diseases COMPANIES • Sublinear scaling of sales, incomes, and profits
  78. vladikk doit-intl.com #DDDEU https://en.wikipedia.org/wiki/List_of_largest_cities_throughout_history

  79. vladikk doit-intl.com #DDDEU https://en.wikipedia.org/wiki/List_of_largest_cities_throughout_history Stone tools, Fire, Bow, Wheel Writing

    Water 
 Mill Gunpowder Printing Press Optical Lens Steam 
 Engine Telegraph Plastics Airplane Transistor Nuclear Power Space Flight Internet Mobile Technology
  80. vladikk doit-intl.com #DDDEU "Technology can bring benefits if, and only

    if, it diminishes a limitation’" - Eliyahu M. Goldratt
  81. vladikk doit-intl.com #DDDEU INNOVATION IN SOFTWARE DESIGN

  82. vladikk doit-intl.com #DDDEU “if one wishes to maintain in a

    great giant the same proportion of limb as that found in an ordinary man he must find a harder and stronger material for making the bones” - Galileo Galilei
  83. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth) Cognitive Limit (superlinear growth)
  84. vladikk doit-intl.com #DDDEU “I have sketched a bone whose natural

    length has been increased three times and whose thickness has been multiplied until, for a correspondingly large animal, it would perform the same function which the small bone performs for its small animal” - Galileo Galilei
  85. vladikk doit-intl.com #DDDEU "Highly complex, self-sustaining structures, whether cells, organisms,

    ecosystems, cities, or corporations, require the close integration of enormous numbers of their constituent units that need e ff icient servicing at all scales. This has been accomplished in living systems by evolving fractal-like, hierarchical branching network systems.” - Geo ff rey West
  86. vladikk doit-intl.com #DDDEU

  87. vladikk doit-intl.com #DDDEU

  88. vladikk doit-intl.com #DDDEU

  89. vladikk doit-intl.com #DDDEU http://paulbourke.net/fractals/googleearth/

  90. vladikk doit-intl.com #DDDEU Y. Chen, P. Cheng, Heat transfer and

    pressure drop in fractal tree-like microchannel nets Lorthois, Sylvie, and Francis Cassot. "Fractal analysis of vascular networks: insights from morphogenesis." Journal of theoretical biology 262.4 (2010): 614-633.
  91. vladikk doit-intl.com #DDDEU https://opte.org Klinkhamer, Christopher, et al. "Functionally fractal

    urban networks: Geospatial co-location and homogeneity of infrastructure."
  92. vladikk doit-intl.com #DDDEU

  93. vladikk doit-intl.com #DDDEU Chihuahua Yorkshire Terrier Pug Beagle Boxer Newfoundland

    1.8kg 3.5kg 7kg 14.5kg 29kg 58kg 110 220 440 880 1,760 3,520 110 180 302 521 876 1,474 Breed Weight Linear Thinking Basal 
 Metabolic 
 Rate
  94. vladikk doit-intl.com #DDDEU West, G. (2018). Scale: The universal laws

    of life and death in organisms, cities and companies. Weidenfeld & Nicolson. NO. OF GASOLINE STATIONS
  95. vladikk doit-intl.com #DDDEU Sublinear 
 Growth Linear 
 Growth Sublinear

    function grows slower than any linear function
  96. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth) Complexity Sublinear growth)
  97. vladikk doit-intl.com #DDDEU FRACTAL MODULARITY

  98. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN Implementation

    Coupling Functional Coupling Model Coupling Contract Coupling Shared Knowledge Encapsulated 
 Knowledge Boundaries Encapsulated 
 Knowledge
  99. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN So

    ft ware systems are sustained by the transport of knowledge (energy) through hierarchical networks of modules.
  100. vladikk doit-intl.com #DDDEU Y. Chen, P. Cheng, Heat transfer and

    pressure drop in fractal tree-like microchannel nets
  101. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth)
  102. vladikk doit-intl.com #DDDEU Knowledge

  103. vladikk doit-intl.com #DDDEU

  104. vladikk doit-intl.com #DDDEU INTEGRATION STRENGTH (S) Implementation Coupling Functional Coupling

    Model Coupling Contract Coupling Shared Knowledge Encapsulated 
 Knowledge Boundaries Encapsulated 
 Knowledge
  105. vladikk doit-intl.com #DDDEU DISTANCE (D) Downstream Module Upstream Module depends

    on Distance
  106. vladikk doit-intl.com #DDDEU DISTANCE (D) M ethods Classes Sub-M odules

    M odules Com ponents (M icro)Services System s Coordination
  107. vladikk doit-intl.com #DDDEU COST OF CHANGE IS PROPORTIONAL TO THE

    DISTANCE BETWEEN COMPONENTS
  108. vladikk doit-intl.com #DDDEU Downstream Module Upstream Module depends on Integration

    Strength (S) Distance (D)
  109. vladikk doit-intl.com #DDDEU LOW STRENGTH HIGH STRENGTH LOW DISTANCE HIGH

    DISTANCE
  110. vladikk doit-intl.com #DDDEU LOW STRENGTH HIGH STRENGTH ? LOW DISTANCE

    HIGH DISTANCE • High cost of cascading changes • Low shared knowledge • Minimizes cascading changes
  111. vladikk doit-intl.com #DDDEU LOW STRENGTH HIGH STRENGTH Loose Coupling LOW

    DISTANCE HIGH DISTANCE • High cost of cascading changes • Low shared knowledge • Minimizes cascading changes
  112. vladikk doit-intl.com #DDDEU LOW STRENGTH HIGH STRENGTH ? Loose Coupling

    LOW DISTANCE HIGH DISTANCE • High shared knowledge • Frequent cascading changes • Low cost of cascading changes
  113. vladikk doit-intl.com #DDDEU LOW STRENGTH HIGH STRENGTH High 
 Cohesion

    Loose Coupling LOW DISTANCE HIGH DISTANCE • High shared knowledge • Frequent cascading changes • Low cost of cascading changes
  114. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    ? Loose Coupling LOW DISTANCE HIGH DISTANCE • Low cost of cascading changes • Low shared knowledge • Co-located unrelated modules
  115. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    Local 
 Complexity Loose Coupling LOW DISTANCE HIGH DISTANCE • Low cost of cascading changes • Low shared knowledge • Co-located unrelated modules
  116. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    Local 
 Complexity Loose Coupling ? LOW DISTANCE HIGH DISTANCE • High cost of cascading changes • High shared knowledge • Frequent cascading changes
  117. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    Local 
 Complexity Loose Coupling Global 
 Complexity LOW DISTANCE HIGH DISTANCE • High cost of cascading changes • High shared knowledge • Frequent cascading changes
  118. vladikk doit-intl.com #DDDEU Local Complexity

  119. vladikk doit-intl.com #DDDEU Global Complexity

  120. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    Local 
 Complexity Loose Coupling Global 
 Complexity LOW DISTANCE HIGH DISTANCE
  121. vladikk doit-intl.com #DDDEU High 
 Cohesion LOW STRENGTH HIGH STRENGTH

    Local 
 Complexity Loose Coupling Global 
 Complexity LOW DISTANCE HIGH DISTANCE
  122. vladikk doit-intl.com #DDDEU High

  123. vladikk doit-intl.com #DDDEU High

  124. vladikk doit-intl.com #DDDEU High

  125. vladikk doit-intl.com #DDDEU 1. Minimize integration strength as much as

    possible 2. Balance integration strength and distance • Both are high? — Reduce distance • Both are low? — Increase distance APPLYING M=S^D
  126. vladikk doit-intl.com #DDDEU Implementation Functional Model Contract INTEGRATION STRENGTH

  127. vladikk doit-intl.com #DDDEU 1. Minimize integration strength as much as

    possible 2. Balance integration strength and distance • Both are high? — Reduce distance • Both are low? — Increase distance 3. Repeat at all levels of abstraction APPLYING M=S^D
  128. vladikk doit-intl.com #DDDEU Strength: 
 Contract M=S^D IN DOMAIN-DRIVEN DESIGN

    Distance Bounded Context Bounded Context
  129. vladikk doit-intl.com #DDDEU Strength: 
 Model M=S^D IN DOMAIN-DRIVEN DESIGN

    Distance Bounded Context
  130. vladikk doit-intl.com #DDDEU Strength: 
 Functional M=S^D IN DOMAIN-DRIVEN DESIGN

    Distance Aggregate
  131. vladikk doit-intl.com #DDDEU Implementation 
 Strength M=S^D IN DOMAIN-DRIVEN DESIGN

    Distance public class CampaignPublishingSaga { private readonly ICampaignRepository _repository; private readonly IList<IDomainEvent> _events; // ... public void Process(CampaignActivated activated) { var campaign = _repository.Load(activated.CampaignId); var advertisingMaterials = campaign.GenerateAdvertisingMaterials); var commandIssuedEvent = new CommandIssuedEvent( target: Target.PublishingService, command: new SubmitAdvertisementCommand(activated.CampaignId, advertisingMaterials)); _events.Append(activated); _events.Append(commandIssuedEvent); } public void Process(PublishingConfirmed confirmed) { var commandIssuedEvent = new CommandIssuedEvent( target: Target.CampaignAggregate, command: new TrackConfirmation(confirmed.CampaignId, confirmed.ConfirmationId)); _events.Append(confirmed); _events.Append(commandIssuedEvent); } public void Process(PublishingRejected rejected) { var commandIssuedEvent = new CommandIssuedEvent( target: Target.CampaignAggregate, command: new TrackRejection(rejected.CampaignId, rejected.RejectionReason)); _events.Append(rejected); _events.Append(commandIssuedEvent); } }
  132. vladikk doit-intl.com #DDDEU M=S^D IN DOMAIN-DRIVEN DESIGN public class CampaignPublishingSaga

    { private readonly ICampaignRepository _repository; private readonly IList<IDomainEvent> _events; // ... public void Process(CampaignActivated activated) { var campaign = _repository.Load(activated.CampaignId); var advertisingMaterials = campaign.GenerateAdvertisingMaterials); var commandIssuedEvent = new CommandIssuedEvent( target: Target.PublishingService, command: new SubmitAdvertisementCommand(activated.CampaignId, advertisingMaterials)); _events.Append(activated); _events.Append(commandIssuedEvent); } public void Process(PublishingConfirmed confirmed) { var commandIssuedEvent = new CommandIssuedEvent( target: Target.CampaignAggregate, command: new TrackConfirmation(confirmed.CampaignId, confirmed.ConfirmationId)); _events.Append(confirmed); _events.Append(commandIssuedEvent); } public void Process(PublishingRejected rejected) { var commandIssuedEvent = new CommandIssuedEvent( target: Target.CampaignAggregate, command: new TrackRejection(rejected.CampaignId, rejected.RejectionReason)); _events.Append(rejected); _events.Append(commandIssuedEvent); } } Bounded Context Bounded Context Bounded Context Aggregate
  133. vladikk doit-intl.com #DDDEU Implementation Functional Model Contract INTEGRATION STRENGTH

  134. vladikk doit-intl.com #DDDEU M = S ^ D

  135. vladikk doit-intl.com #DDDEU “The most e ff ective tool available

    for dealing with complexity is abstraction. Many types of abstraction can be used, but encapsulation is the main form of abstraction by which complexity is managed in object-oriented programming.” - Rebecca Wirfs-Brock
  136. vladikk doit-intl.com #DDDEU WRAP UP

  137. vladikk doit-intl.com #DDDEU KNOWLEDGE: THE ENERGY OF SOFTWARE DESIGN So

    ft ware systems are sustained by the transport of knowledge (energy) through hierarchical networks of modules.
  138. vladikk doit-intl.com #DDDEU Knowledge (sublinear growth) Complexity (superlinear growth) Cognitive

    Limit (No growth) Functionality (Linear growth)
  139. vladikk doit-intl.com #DDDEU High

  140. vladikk doit-intl.com #DDDEU

  141. vladikk doit-intl.com #DDDEU

  142. @vladikk vladikk.com vladik at khononov.com

  143. @vladikk vladikk.com vladik at khononov.com

  144. @vladikk vladikk.com vladik at khononov.com THANK YOU!