$30 off During Our Annual Pro Sale. View Details »

The Fractal Geometry of Software Design

The Fractal Geometry of Software Design

Presented at Domain-Driven Design Europe 2022 (Keynote)

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

    View Slide

  2. @vladikk
    vladikk.com
    [email protected]
    VLADIK (VLAD)

    KHONONOV

    View Slide

  3. vladikk doit-intl.com
    #DDDEU

    View Slide

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


    • How creative are we?


    • How profitable are our companies?

    View Slide

  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?

    View Slide

  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.

    View Slide

  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.

    View Slide

  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

    View Slide

  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?

    View Slide

  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?

    View Slide

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

    View Slide

  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.

    View Slide

  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?

    View Slide

  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

    View Slide

  15. vladikk doit-intl.com
    #DDDEU

    View Slide

  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

    View Slide

  17. vladikk doit-intl.com
    #DDDEU
    ENERGY SUPPLY

    NETWORKS

    View Slide

  18. vladikk doit-intl.com
    #DDDEU
    ENERGY SUPPLY NETWORKS
    Systems that are sustained by the transport of
    energy through hierarchical networks.

    View Slide

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

    View Slide

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

    View Slide

  21. vladikk doit-intl.com
    #DDDEU
    SOFTWARE DESIGN


    AS AN ENERGY SUPPLY NETWORK

    View Slide

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

    View Slide

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

    View Slide

  24. vladikk doit-intl.com
    #DDDEU

    View Slide

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

    Knowledge
    Boundaries
    Encapsulated

    Knowledge

    View Slide

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


    Functional Coupling


    Model Coupling


    Contract Coupling

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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)

    View Slide

  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

    View Slide

  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.

    View Slide

  34. vladikk doit-intl.com
    #DDDEU
    ECONOMIES OF SCALE IN

    ENERGY SUPPLY NETWORKS

    View Slide

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

    View Slide

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

    View Slide

  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.

    View Slide

  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.

    View Slide

  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.

    View Slide

  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

    View Slide

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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

  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.

    View Slide

  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.

    View Slide

  49. vladikk doit-intl.com
    #DDDEU
    y = x1.15
    y = x
    Superlinear

    Growth
    Linear

    Growth
    Superlinear function grows faster than any linear function

    View Slide

  50. vladikk doit-intl.com
    #DDDEU
    ECONOMIES OF SCALE
    Superlinear

    Growth
    Sublinear

    Growth
    Linear

    Growth

    View Slide

  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.

    View Slide

  52. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Functionality


    (Linear growth)

    View Slide

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

    Growth
    Sublinear

    Growth
    Linear

    Growth

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  57. vladikk doit-intl.com
    #DDDEU

    View Slide

  58. vladikk doit-intl.com
    #DDDEU

    View Slide

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

    View Slide

  60. vladikk doit-intl.com
    #DDDEU
    x2
    x2
    x2
    Weight increase:
    Strength increase:
    2 * 2 * 2 = x8
    2 * 2 = x4

    View Slide

  61. vladikk doit-intl.com
    #DDDEU

    View Slide

  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

    View Slide

  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
    ?

    View Slide

  64. vladikk doit-intl.com
    #DDDEU
    GROWTH LIMITS IN


    SOFTWARE SYSTEMS

    View Slide

  65. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Functionality


    (Linear growth)

    View Slide

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

    View Slide

  67. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)

    View Slide

  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.

    View Slide

  69. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)

    View Slide

  70. vladikk doit-intl.com
    #DDDEU
    Knowledge


    - Galileo Galilei

    View Slide

  71. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)

    View Slide

  72. vladikk doit-intl.com
    #DDDEU
    EXTENDING


    GROWTH LIMITS

    View Slide

  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

    View Slide

  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

    View Slide

  75. vladikk doit-intl.com
    #DDDEU
    POSTPONING GROWTH LIMITS
    1. Adapt form / shape to withstand increased stress


    2. Use stronger materials

    View Slide

  76. vladikk doit-intl.com
    #DDDEU
    SUSTAINABLE GROWTH

    REQUIRES INNOVATION

    View Slide

  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


    View Slide

  78. vladikk doit-intl.com
    #DDDEU
    https://en.wikipedia.org/wiki/List_of_largest_cities_throughout_history

    View Slide

  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

    View Slide

  80. vladikk doit-intl.com
    #DDDEU
    "Technology can bring benefits if, and only if, it diminishes a limitation’"


    - Eliyahu M. Goldratt

    View Slide

  81. vladikk doit-intl.com
    #DDDEU
    INNOVATION


    IN SOFTWARE DESIGN

    View Slide

  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

    View Slide

  83. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)
    Cognitive Limit


    (superlinear growth)

    View Slide

  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

    View Slide

  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

    View Slide

  86. vladikk doit-intl.com
    #DDDEU

    View Slide

  87. vladikk doit-intl.com
    #DDDEU

    View Slide

  88. vladikk doit-intl.com
    #DDDEU

    View Slide

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

    View Slide

  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.

    View Slide

  91. vladikk doit-intl.com
    #DDDEU
    https://opte.org
    Klinkhamer, Christopher, et al. "Functionally fractal urban networks: Geospatial co-location and
    homogeneity of infrastructure."

    View Slide

  92. vladikk doit-intl.com
    #DDDEU

    View Slide

  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

    View Slide

  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

    View Slide

  95. vladikk doit-intl.com
    #DDDEU
    Sublinear

    Growth
    Linear

    Growth
    Sublinear function grows slower than any linear function

    View Slide

  96. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)
    Complexity


    Sublinear growth)

    View Slide

  97. vladikk doit-intl.com
    #DDDEU
    FRACTAL MODULARITY

    View Slide

  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

    View Slide

  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.

    View Slide

  100. vladikk doit-intl.com
    #DDDEU
    Y. Chen, P. Cheng, Heat transfer and pressure drop in fractal tree-like microchannel nets

    View Slide

  101. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)

    View Slide

  102. vladikk doit-intl.com
    #DDDEU
    Knowledge


    View Slide

  103. vladikk doit-intl.com
    #DDDEU

    View Slide

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


    Functional Coupling


    Model Coupling


    Contract Coupling Shared Knowledge
    Encapsulated

    Knowledge
    Boundaries
    Encapsulated

    Knowledge

    View Slide

  105. vladikk doit-intl.com
    #DDDEU
    DISTANCE (D)
    Downstream
    Module
    Upstream
    Module depends on
    Distance

    View Slide

  106. vladikk doit-intl.com
    #DDDEU
    DISTANCE (D)
    M
    ethods
    Classes
    Sub-M
    odules
    M
    odules
    Com
    ponents
    (M
    icro)Services
    System
    s
    Coordination

    View Slide

  107. vladikk doit-intl.com
    #DDDEU
    COST OF CHANGE IS PROPORTIONAL


    TO THE DISTANCE BETWEEN COMPONENTS

    View Slide

  108. vladikk doit-intl.com
    #DDDEU
    Downstream
    Module
    Upstream
    Module depends on
    Integration
    Strength (S)
    Distance (D)

    View Slide

  109. vladikk doit-intl.com
    #DDDEU
    LOW


    STRENGTH
    HIGH


    STRENGTH
    LOW


    DISTANCE
    HIGH
    DISTANCE

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  118. vladikk doit-intl.com
    #DDDEU
    Local


    Complexity

    View Slide

  119. vladikk doit-intl.com
    #DDDEU
    Global


    Complexity

    View Slide

  120. vladikk doit-intl.com
    #DDDEU
    High

    Cohesion
    LOW


    STRENGTH
    HIGH


    STRENGTH
    Local

    Complexity
    Loose
    Coupling
    Global

    Complexity
    LOW


    DISTANCE
    HIGH
    DISTANCE

    View Slide

  121. vladikk doit-intl.com
    #DDDEU
    High

    Cohesion
    LOW


    STRENGTH
    HIGH


    STRENGTH
    Local

    Complexity
    Loose
    Coupling
    Global

    Complexity
    LOW


    DISTANCE
    HIGH
    DISTANCE

    View Slide

  122. vladikk doit-intl.com
    #DDDEU
    High


    View Slide

  123. vladikk doit-intl.com
    #DDDEU
    High


    View Slide

  124. vladikk doit-intl.com
    #DDDEU
    High


    View Slide

  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

    View Slide

  126. vladikk doit-intl.com
    #DDDEU
    Implementation


    Functional


    Model


    Contract
    INTEGRATION STRENGTH

    View Slide

  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

    View Slide

  128. vladikk doit-intl.com
    #DDDEU
    Strength:

    Contract
    M=S^D IN DOMAIN-DRIVEN DESIGN
    Distance
    Bounded
    Context
    Bounded
    Context

    View Slide

  129. vladikk doit-intl.com
    #DDDEU
    Strength:

    Model
    M=S^D IN DOMAIN-DRIVEN DESIGN
    Distance
    Bounded Context

    View Slide

  130. vladikk doit-intl.com
    #DDDEU
    Strength:

    Functional
    M=S^D IN DOMAIN-DRIVEN DESIGN
    Distance
    Aggregate

    View Slide

  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 _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);
    }
    }

    View Slide

  132. vladikk doit-intl.com
    #DDDEU
    M=S^D IN DOMAIN-DRIVEN DESIGN
    public class CampaignPublishingSaga
    {
    private readonly ICampaignRepository _repository;
    private readonly IList _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

    View Slide

  133. vladikk doit-intl.com
    #DDDEU
    Implementation


    Functional


    Model


    Contract
    INTEGRATION STRENGTH

    View Slide

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

    View Slide

  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

    View Slide

  136. vladikk doit-intl.com
    #DDDEU
    WRAP UP

    View Slide

  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.

    View Slide

  138. vladikk doit-intl.com
    #DDDEU
    Knowledge


    (sublinear growth)
    Complexity


    (superlinear growth)
    Cognitive Limit


    (No growth)
    Functionality


    (Linear growth)

    View Slide

  139. vladikk doit-intl.com
    #DDDEU
    High


    View Slide

  140. vladikk doit-intl.com
    #DDDEU

    View Slide

  141. vladikk doit-intl.com
    #DDDEU

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide