Bridging the Divide between
Architecture and Code
Chris Chedgey
Structure101
?
✗
✗
✗
✗
The Divide is a problem because…
The Divide is a problem because…
• Invisible, emergent, accidental structure fights
against developers
The Divide is a problem because…
• Invisible, emergent, accidental structure fights
against developers
• Invisible, disconnected architecture could
guide developers … but doesn’t
The Divide is a problem because…
• Invisible, emergent, accidental structure
fights against developers
• Invisible, disconnected architecture could
guide developers … but doesn’t
Invisible structure fights developers
because…
• Invisible structure becomes tangled
V 0.7.2
V 0.8.6
V 0.8.7
V 0.8.8
V 1.0.0
V 1.3.0
V 1.3.5
• Invisible structure becomes tangled
Invisible structure fights developers
because…
• Invisible structure becomes tangled
• Tangles increase complexity
Invisible structure fights developers
because…
Tangles increase complexity
CCD = (1*1) + (11*2) + (7*3) + …
~ 164
CCD = 362 = 1,296 !!!
Cumulative Component Dependency
(John Lakos)
• Invisible structure becomes tangled
• Tangles increase complexity
Invisible structure fights developers
because…
• Invisible structure becomes tangled
• Tangles increase complexity
• Complexity is hard to understand
Invisible structure fights developers
because…
Complexity is hard to understand
• Invisible structure becomes tangled
• Tangles increase complexity
• Complexity is hard to understand
Invisible structure fights developers
because…
• Invisible structure becomes tangled
• Tangles increase complexity
• Complexity is hard to understand
• Tangles make a monolith
Invisible structure fights developers
because…
Tangles make a monolith
Tangles make a monolith
Tangles make a monolith
Tangles make a monolith
Tangles make a monolith
✗
• Invisible structure becomes tangled
• Tangles increase complexity
• Complexity is hard to understand
• Tangles make a monolith
Invisible structure fights developers
because…
The Divide is a problem because…
• Invisible, emergent, accidental structure
fights against developers
• Invisible, disconnected architecture could
guide developers … but doesn’t
The Divide is a problem because…
• Invisible, emergent, accidental structure fights
against developers
• Invisible, disconnected architecture could
guide developers … but doesn’t
Architecture could guide developers
Architecture could guide developers
• Define/enforce layering
Architecture could guide developers
• Define/enforce layering
Architecture could guide developers
• Define/enforce layering
Architecture could guide developers
• Define/enforce layering
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
• Allow for future module replacement
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
• Allow for future module replacement
• Guide new developers
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
• Allow for future module replacement
• Guide new developers
• Phased/parallel development
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
• Allow for future module replacement
• Guide new developers
• Phased/parallel development
• Modularity!
Architecture could guide developers
• Define/enforce layering
• Group related modules/packages
• Define/enforce interface-implementation
• Prevent dependency proliferation
• Allow for future module replacement
• Guide new developers
• Phased/parallel development
• Modularity!
• …
Bridging the divide
Bridging the divide
Bridging the divide
Bridging the divide
Bridging the divide
Bridging the divide
Bridging the divide
Bridging the divide
1. Start visualizing the structure you have now
Bridging the divide
1. Start visualizing the structure you have now
2. Lock-in any useful architecture you have now
– overlay the visualization
Bridging the divide
1. Start visualizing the structure you have now
2. Lock-in any useful architecture you have now
– overlay the visualization
3. Improve/extend the architecture –
development gets easier and easier
• You’re going to need a tool…
• That parses code
• Hierarchical dependency model
• Architectural overlays
• You’re going to need a tool…
• That parses code
• Hierarchical dependency model
• Architectural overlays
• SonarGraph
Hierarchical
dependency graph
DSM - Dependency Structure Matrix
• You’re going to need a tool…
• That parses code
• Hierarchical dependency model
• Architectural overlays
• SonarGraph
• Lattix
• IntelliJ Idea Ultimate
Hierarchical
dependency graph
DSM - Dependency Structure Matrix
LSM – Levelized Structure Map
• You’re going to need a tool…
• That parses code
• Hierarchical dependency model
• Architectural overlays
• SonarGraph
• Lattix
• IntelliJ Idea Ultimate
• Structure101
Hierarchical
dependency graph
Step 1: Visualize what you have
Step 1: Visualize what you have
• Immediate productivity boost
– A map of the codebase
Step 1: Visualize what you have
• Immediate productivity boost
– A map of the codebase
• See the details in the context of the de facto
architecture, e.g.
– Eclipse projects
– IntelliJ modules
– Maven POMs
– Java 9 modules
– …
Step 1: Visualize what you have
• Immediate productivity boost
– A map of the codebase
• See the details in the context of the de facto
architecture, e.g.
– Eclipse projects
– IntelliJ modules
– Maven POMs
– Java 9 modules
– …
• Raise structural awareness
– Start simplifying the codebase - reduce coupling and
complexity
Step 1: Visualization Demo
Step 2: Lock in and shore up de facto
architecture
Step 2: Lock in and shore up de facto
architecture
• Organize modules into groups
Step 2: Lock in and shore up de facto
architecture
• Organize modules into groups
• Specify module dependency constraints
Step 2: Lock in and shore up de facto
architecture
• Organize modules into groups
• Specify module dependency constraints
• Overlay onto the visualization
– Understand the details in the context of the spec’d
architecture
– Warned immediately if edits violate spec
Step 2: Structure Spec Demo
Step 3: Incrementally improve the
architecture/structure
Step 3: Incrementally improve the
architecture/structure
• Deal with the monoliths
– Increase %specified
Step 3: Incrementally improve the
architecture/structure
• Deal with the monoliths
– Increase %specified
• Lift lower packages into modules
Step 3: Incrementally improve the
architecture/structure
• Deal with the monoliths
– Increase %specified
• Lift lower packages into modules
• Disentangle packages…
– Small/easy: In the code
– Broader: Simulate first
– Move classes, then refactor for dependencies
Step 3: Incrementally improve the
architecture/structure
• Deal with the monoliths
– Increase %specified
• Lift lower packages into modules
• Disentangle packages…
– Small/easy: In the code
– Broader: Simulate first
– Move classes, then refactor for dependencies
• … and/or Extract modules
– Simulate first
– Add new module to spec
– Refactor for dependencies, then move classes
Step 3: Structure101 Studio Demo
Bridging the gap…
Summary
Bridging the gap…
Summary
1. Start visualizing the structure you have now
Bridging the gap…
Summary
1. Start visualizing the structure you have now
2. Lock-in and shore-up any useful architecture
you have now – overlay the visualization
Bridging the gap…
Summary
1. Start visualizing the structure you have now
2. Lock-in and shore-up any useful architecture
you have now – overlay the visualization
3. Improve/extend the architecture –
development gets easier and easier
Questions?
@chedgey
chris@structure101.com
structure101.com
Early access to Workspace:
2018.structure101.com

Bridging the Divide between Architecture and Code (Germany JUGs version)

  • 1.
    Bridging the Dividebetween Architecture and Code Chris Chedgey Structure101
  • 4.
  • 7.
  • 8.
  • 9.
  • 10.
    The Divide isa problem because…
  • 11.
    The Divide isa problem because… • Invisible, emergent, accidental structure fights against developers
  • 12.
    The Divide isa problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  • 13.
    The Divide isa problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  • 14.
    Invisible structure fightsdevelopers because… • Invisible structure becomes tangled
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
    • Invisible structurebecomes tangled Invisible structure fights developers because…
  • 23.
    • Invisible structurebecomes tangled • Tangles increase complexity Invisible structure fights developers because…
  • 24.
    Tangles increase complexity CCD= (1*1) + (11*2) + (7*3) + … ~ 164 CCD = 362 = 1,296 !!! Cumulative Component Dependency (John Lakos)
  • 25.
    • Invisible structurebecomes tangled • Tangles increase complexity Invisible structure fights developers because…
  • 26.
    • Invisible structurebecomes tangled • Tangles increase complexity • Complexity is hard to understand Invisible structure fights developers because…
  • 27.
    Complexity is hardto understand
  • 28.
    • Invisible structurebecomes tangled • Tangles increase complexity • Complexity is hard to understand Invisible structure fights developers because…
  • 29.
    • Invisible structurebecomes tangled • Tangles increase complexity • Complexity is hard to understand • Tangles make a monolith Invisible structure fights developers because…
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
    Tangles make amonolith ✗
  • 35.
    • Invisible structurebecomes tangled • Tangles increase complexity • Complexity is hard to understand • Tangles make a monolith Invisible structure fights developers because…
  • 36.
    The Divide isa problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  • 37.
    The Divide isa problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  • 38.
  • 39.
    Architecture could guidedevelopers • Define/enforce layering
  • 40.
    Architecture could guidedevelopers • Define/enforce layering
  • 41.
    Architecture could guidedevelopers • Define/enforce layering
  • 42.
    Architecture could guidedevelopers • Define/enforce layering
  • 43.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages
  • 44.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages
  • 45.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages
  • 46.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages
  • 47.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  • 48.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  • 49.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  • 50.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation
  • 51.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement
  • 52.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement • Guide new developers
  • 53.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement • Guide new developers • Phased/parallel development
  • 54.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement • Guide new developers • Phased/parallel development • Modularity!
  • 55.
    Architecture could guidedevelopers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement • Guide new developers • Phased/parallel development • Modularity! • …
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
    Bridging the divide 1.Start visualizing the structure you have now
  • 64.
    Bridging the divide 1.Start visualizing the structure you have now 2. Lock-in any useful architecture you have now – overlay the visualization
  • 65.
    Bridging the divide 1.Start visualizing the structure you have now 2. Lock-in any useful architecture you have now – overlay the visualization 3. Improve/extend the architecture – development gets easier and easier
  • 66.
    • You’re goingto need a tool… • That parses code • Hierarchical dependency model • Architectural overlays
  • 67.
    • You’re goingto need a tool… • That parses code • Hierarchical dependency model • Architectural overlays • SonarGraph Hierarchical dependency graph
  • 68.
    DSM - DependencyStructure Matrix • You’re going to need a tool… • That parses code • Hierarchical dependency model • Architectural overlays • SonarGraph • Lattix • IntelliJ Idea Ultimate Hierarchical dependency graph
  • 69.
    DSM - DependencyStructure Matrix LSM – Levelized Structure Map • You’re going to need a tool… • That parses code • Hierarchical dependency model • Architectural overlays • SonarGraph • Lattix • IntelliJ Idea Ultimate • Structure101 Hierarchical dependency graph
  • 70.
    Step 1: Visualizewhat you have
  • 71.
    Step 1: Visualizewhat you have • Immediate productivity boost – A map of the codebase
  • 72.
    Step 1: Visualizewhat you have • Immediate productivity boost – A map of the codebase • See the details in the context of the de facto architecture, e.g. – Eclipse projects – IntelliJ modules – Maven POMs – Java 9 modules – …
  • 73.
    Step 1: Visualizewhat you have • Immediate productivity boost – A map of the codebase • See the details in the context of the de facto architecture, e.g. – Eclipse projects – IntelliJ modules – Maven POMs – Java 9 modules – … • Raise structural awareness – Start simplifying the codebase - reduce coupling and complexity
  • 74.
  • 75.
    Step 2: Lockin and shore up de facto architecture
  • 76.
    Step 2: Lockin and shore up de facto architecture • Organize modules into groups
  • 77.
    Step 2: Lockin and shore up de facto architecture • Organize modules into groups • Specify module dependency constraints
  • 78.
    Step 2: Lockin and shore up de facto architecture • Organize modules into groups • Specify module dependency constraints • Overlay onto the visualization – Understand the details in the context of the spec’d architecture – Warned immediately if edits violate spec
  • 79.
  • 80.
    Step 3: Incrementallyimprove the architecture/structure
  • 81.
    Step 3: Incrementallyimprove the architecture/structure • Deal with the monoliths – Increase %specified
  • 82.
    Step 3: Incrementallyimprove the architecture/structure • Deal with the monoliths – Increase %specified • Lift lower packages into modules
  • 83.
    Step 3: Incrementallyimprove the architecture/structure • Deal with the monoliths – Increase %specified • Lift lower packages into modules • Disentangle packages… – Small/easy: In the code – Broader: Simulate first – Move classes, then refactor for dependencies
  • 84.
    Step 3: Incrementallyimprove the architecture/structure • Deal with the monoliths – Increase %specified • Lift lower packages into modules • Disentangle packages… – Small/easy: In the code – Broader: Simulate first – Move classes, then refactor for dependencies • … and/or Extract modules – Simulate first – Add new module to spec – Refactor for dependencies, then move classes
  • 85.
  • 86.
  • 87.
    Bridging the gap… Summary 1.Start visualizing the structure you have now
  • 88.
    Bridging the gap… Summary 1.Start visualizing the structure you have now 2. Lock-in and shore-up any useful architecture you have now – overlay the visualization
  • 89.
    Bridging the gap… Summary 1.Start visualizing the structure you have now 2. Lock-in and shore-up any useful architecture you have now – overlay the visualization 3. Improve/extend the architecture – development gets easier and easier
  • 90.

Editor's Notes

  • #67 You cannot do structure in the IDE alone – structure emerges from the code
  • #68 You cannot do structure in the IDE alone – structure emerges from the code
  • #69 You cannot do structure in the IDE alone – structure emerges from the code
  • #70 You cannot do structure in the IDE alone – structure emerges from the code