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 the talk I held at 50th meeting of Java User Group Saxony. @springcentral

977c74bb044a9d4fa90b305824eda390?s=128

Oliver Drotbohm

September 04, 2014
Tweet

Transcript

  1. Whoops! Where did my architecture go? Architecture management for Java

    applications ! Oliver Gierke
  2. None
  3. None
  4. None
  5. Background 5 years of consulting Lots of code reviews Eoin

    Woods‘ talk on InfoQ Lot of input from fellows
  6. "If you think architecture is expensive, try no architecture.

  7. Macro VS. Micro Architecture

  8. Macro VS. Micro Architecture

  9. None
  10. Orders Inventory Billing

  11. Orders Inventory Billing

  12. Orders Inventory Billing Macro-Architecture JMS REST AMQP

  13. Orders Inventory Billing Macro-Architecture Micro-Architecture JMS REST AMQP

  14. JRuby Java Scala Macro-Architecture Micro-Architecture AMQP JMS REST

  15. Neo4j RDBMS MongoDB Macro-Architecture Micro-Architecture from Stefan Tilkov -
 Breaking

    the Monolith JMS REST AMQP
  16. Roadmap Divide and conquer Of layers and slices A plain

    Java based approach
  17. Architecture 101

  18. Know your dependencies

  19. Explicit / Visible dependencies

  20. Granularity Modules Layers Vertical slices Subsystems

  21. Granularity Java ARchive Package Class

  22. Divide and conquer

  23. Component

  24. Component Single unit to understand

  25. Component Single unit to change

  26. Component Scope of risk of change

  27. B Smaller unit to understand A

  28. B Reduced risk of change A

  29. B Cost of separation A

  30. B Definition and maintenance of dependencies A

  31. "Meanwhile, in my friend’s project…

  32. How do I add a feature?

  33. How do I add a feature? New
 Feature © Eberhard

    Wolff
  34. Of layers and slices…

  35. Presentation Service Data Access

  36. Presentation Service Data Access Account Customer Core

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

  38. Slices Hardly understood New to developers Key for business requirements

  39. Presentation Service Data Access Account Customer Core

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

  41. Architecture VS. Codebase

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

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

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

  45. Code analysis JDepend Sonar

  46. Sonargraph Formerly known as SonarJ

  47. Demo

  48. jQAssistant http://github.com/buschmais/jqassistant

  49. A plain Java based approach

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

  51. Presentation Service Data Access Account Customer Core

  52. Packages

  53. ….layer.slice ….slice.layer ….slice

  54. ….web.core ….service.core ….repository.core

  55. ….core.web ….core.service ….core.repository

  56. ….core ….customer ….account

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

  58. "Does it make a difference?

  59. Dependency management

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

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

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

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

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

  65. Presentation Service Data Access Account Customer Core

  66. Presentation Service Data Access Account Customer Core

  67. Demo

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

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

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

  71. Oliver Gierke Spring Data Project Lead ! ogierke@pivotal.io olivergierke www.olivergierke.de

  72. Thanks & Credits Eoin Woods - Talk @ InfoQ Stefan

    Tilkov - Talk @ InfoQ Eberhard Wolff - Slides @ Slideshare