Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

167 views

Published on

(Version from German JUG talks April 2018)

Abstract

Static diagrams on wikis and white-boards might capture the vision of architects, but they don’t much help programmers to understand how the code they’re working on right now fits into the architecture. Nor are the programmers warned when they violate the diagrams as they forge changes, line-by-line.

This is a huge problem – it is ultimately individual lines of code that make or break an architecture; and we know that a clean architecture will help teams develop a more flexible product, with less complexity, less wasted effort, etc. Worse, without practical architectural guidance, programmers wrestle with invisible structures that emerge from thousands of inter-dependent lines of code.

And being invisible, these structures become ever more complex, coupled, and tangled. In fact, uncontrolled structure actively fights against productive development.

This talk shows how to rein in emergent code-base structures and gradually transform them into a cogent, defined architecture. You will see how…
- Visualizing the emergent structure makes a code-base easier to understand.
- Restructuring to remove tangles and reduce coupling makes the visualized code-base easier to work on.
- Specifying layering and dependency rules converts good structure into a controlled architecture that guides the team as the code-base evolves and grows.

A key ingredient is a live visualization, inside the IDE, of the detailed code the programmer is working on, in the context of the overall architecture. In short, you will learn how bridging the architect/programmer divide can convert code-base structure from liability into an asset that actively works for development productivity.

Published in: Software
  • Be the first to comment

  • Be the first to like this

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

  1. 1. Bridging the Divide between Architecture and Code Chris Chedgey Structure101
  2. 2. ?
  3. 3.
  4. 4.
  5. 5. ✗ ✗
  6. 6. The Divide is a problem because…
  7. 7. The Divide is a problem because… • Invisible, emergent, accidental structure fights against developers
  8. 8. The Divide is a problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  9. 9. The Divide is a problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  10. 10. Invisible structure fights developers because… • Invisible structure becomes tangled
  11. 11. V 0.7.2
  12. 12. V 0.8.6
  13. 13. V 0.8.7
  14. 14. V 0.8.8
  15. 15. V 1.0.0
  16. 16. V 1.3.0
  17. 17. V 1.3.5
  18. 18. • Invisible structure becomes tangled Invisible structure fights developers because…
  19. 19. • Invisible structure becomes tangled • Tangles increase complexity Invisible structure fights developers because…
  20. 20. Tangles increase complexity CCD = (1*1) + (11*2) + (7*3) + … ~ 164 CCD = 362 = 1,296 !!! Cumulative Component Dependency (John Lakos)
  21. 21. • Invisible structure becomes tangled • Tangles increase complexity Invisible structure fights developers because…
  22. 22. • Invisible structure becomes tangled • Tangles increase complexity • Complexity is hard to understand Invisible structure fights developers because…
  23. 23. Complexity is hard to understand
  24. 24. • Invisible structure becomes tangled • Tangles increase complexity • Complexity is hard to understand Invisible structure fights developers because…
  25. 25. • Invisible structure becomes tangled • Tangles increase complexity • Complexity is hard to understand • Tangles make a monolith Invisible structure fights developers because…
  26. 26. Tangles make a monolith
  27. 27. Tangles make a monolith
  28. 28. Tangles make a monolith
  29. 29. Tangles make a monolith
  30. 30. Tangles make a monolith ✗
  31. 31. • Invisible structure becomes tangled • Tangles increase complexity • Complexity is hard to understand • Tangles make a monolith Invisible structure fights developers because…
  32. 32. The Divide is a problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  33. 33. The Divide is a problem because… • Invisible, emergent, accidental structure fights against developers • Invisible, disconnected architecture could guide developers … but doesn’t
  34. 34. Architecture could guide developers
  35. 35. Architecture could guide developers • Define/enforce layering
  36. 36. Architecture could guide developers • Define/enforce layering
  37. 37. Architecture could guide developers • Define/enforce layering
  38. 38. Architecture could guide developers • Define/enforce layering
  39. 39. Architecture could guide developers • Define/enforce layering • Group related modules/packages
  40. 40. Architecture could guide developers • Define/enforce layering • Group related modules/packages
  41. 41. Architecture could guide developers • Define/enforce layering • Group related modules/packages
  42. 42. Architecture could guide developers • Define/enforce layering • Group related modules/packages
  43. 43. Architecture could guide developers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  44. 44. Architecture could guide developers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  45. 45. Architecture could guide developers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation
  46. 46. Architecture could guide developers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation
  47. 47. Architecture could guide developers • Define/enforce layering • Group related modules/packages • Define/enforce interface-implementation • Prevent dependency proliferation • Allow for future module replacement
  48. 48. 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
  49. 49. 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
  50. 50. 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!
  51. 51. 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! • …
  52. 52. Bridging the divide
  53. 53. Bridging the divide
  54. 54. Bridging the divide
  55. 55. Bridging the divide
  56. 56. Bridging the divide
  57. 57. Bridging the divide
  58. 58. Bridging the divide
  59. 59. Bridging the divide 1. Start visualizing the structure you have now
  60. 60. Bridging the divide 1. Start visualizing the structure you have now 2. Lock-in any useful architecture you have now – overlay the visualization
  61. 61. 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
  62. 62. • You’re going to need a tool… • That parses code • Hierarchical dependency model • Architectural overlays
  63. 63. • You’re going to need a tool… • That parses code • Hierarchical dependency model • Architectural overlays • SonarGraph Hierarchical dependency graph
  64. 64. 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
  65. 65. 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
  66. 66. Step 1: Visualize what you have
  67. 67. Step 1: Visualize what you have • Immediate productivity boost – A map of the codebase
  68. 68. 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 – …
  69. 69. 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
  70. 70. Step 1: Visualization Demo
  71. 71. Step 2: Lock in and shore up de facto architecture
  72. 72. Step 2: Lock in and shore up de facto architecture • Organize modules into groups
  73. 73. Step 2: Lock in and shore up de facto architecture • Organize modules into groups • Specify module dependency constraints
  74. 74. 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
  75. 75. Step 2: Structure Spec Demo
  76. 76. Step 3: Incrementally improve the architecture/structure
  77. 77. Step 3: Incrementally improve the architecture/structure • Deal with the monoliths – Increase %specified
  78. 78. Step 3: Incrementally improve the architecture/structure • Deal with the monoliths – Increase %specified • Lift lower packages into modules
  79. 79. 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
  80. 80. 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
  81. 81. Step 3: Structure101 Studio Demo
  82. 82. Bridging the gap… Summary
  83. 83. Bridging the gap… Summary 1. Start visualizing the structure you have now
  84. 84. 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
  85. 85. 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
  86. 86. Questions? @chedgey chris@structure101.com structure101.com Early access to Workspace: 2018.structure101.com

×