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

Whoops! Where Did My Architecture Go?

Whoops! Where Did My Architecture Go?

Slides of my talk at BEDCon 2013 in Berlin, Germany.

977c74bb044a9d4fa90b305824eda390?s=128

Oliver Drotbohm

April 05, 2013
Tweet

More Decks by Oliver Drotbohm

Other Decks in Programming

Transcript

  1. Whoops! Where did my architecture go? Approaches to architecture management

    for Java and Spring applications Oliver Gierke
  2. Oliver Gierke SpringSource Engineer Spring Data ogierke@vmware.com olivergierke www.olivergierke.de

  3. Background 5 years of consulting Lots of code reviews Eoin

    Woods‘ talk on InfoQ
  4. "If you think architecture is expensive, try no architecture.

  5. Macro VS. Micro Architecture

  6. Macro VS. Micro Architecture

  7. Sample Code http://github.com/olivergierke/ whoops-architecture

  8. Roadmap Divide and conquer Of layers and slices A plain

    Java based approach
  9. Architecture 101

  10. Know your dependencies

  11. Explicit / Visible dependencies

  12. Granularity Modules Layers Vertical slices Subsystems

  13. Granularity Java ARchive Package Class

  14. Divide and conquer

  15. Component

  16. Component Single unit to understand

  17. Component Single unit to change

  18. Component Scope of risk of change

  19. B A

  20. B A

  21. B Cost of separation A

  22. B Definition and maintenance of dependencies A

  23. B Smaller unit to understand A

  24. B Reduced risk of change A

  25. Of layers and slices…

  26. None
  27. None
  28. Presentation Service Data Access

  29. Presentation Service Data Access

  30. Presentation Service Data Access

  31. Presentation Service Data Access Account Customer Core

  32. Presentation Service Data Access Account Customer Core

  33. Presentation Service Data Access Account Customer Core

  34. Layers Well understood Known to developers Less important to business

  35. Slices Hardly understood New to developers Key for business req

  36. Presentation Service Data Access Account Customer Core

  37. "How to implement an architecture inside a codebase?

  38. Architecture VS. Codebase

  39. "How to implement an architecture inside a codebase?

  40. "How to implement an architecture inside a codebase?

  41. "How to maintain an architecture inside a codebase?

  42. Code analysis JDepend Sonar

  43. Demo

  44. Sonargraph Formerly known as SonarJ

  45. Demo

  46. A plain Java based approach

  47. "How far can we get with plain Java means only?

  48. Presentation Service Data Access Account Customer Core

  49. Packages

  50. ….layer.slice ….slice.layer ….slice

  51. ….web.core ….service.core ….repository.core

  52. ….core.web ….core.service ….core.repository

  53. ….core ….customer ….account

  54. "Why the f#$k should I even care?

  55. "Does it make a difference?

  56. Dependency management

  57. "You only need to manage, what you can refer to…

  58. Layers first Leaks slice internals Lower layers visible to everyone

  59. Slices first/only Start with package per slice Expose interfaces and

    domain types Keep implementations private
  60. Slices first/only Encapsulates business module Internals understood anyway

  61. "Start with less packages and the least visibility possible…

  62. Presentation Service Data Access Account Customer Core

  63. Presentation Service Data Access Account Customer Core

  64. Demo

  65. Take-aways Know your dependencies On every granularity Start as strict

    as possible Get lenient where necessary
  66. Resources Spring Data JPA @ GitHub Sonargraph Blogpost

  67. Thanks & credits Eoin Woods - Talk @ InfoQ Uwe

    Friedrichsen - Slides @ Slideshare