Whoops! Where did my architecture go?

Whoops! Where did my architecture go?

Slides of the talk on maintaining software architecture in Java applications I gave at GeeCON Prague 2014. @springcentral

977c74bb044a9d4fa90b305824eda390?s=128

Oliver Drotbohm

October 23, 2014
Tweet

Transcript

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

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

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

  8. "Architecture is like weather: you can’t have none.

  9. Macro VS. Micro Architecture

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

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

  12. Neo4j RDBMS MongoDB Macro-Architecture Micro-Architecture JMS REST AMQP

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

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

    Java based approach
  15. Architecture 101

  16. Know your dependencies

  17. Explicit / Visible dependencies

  18. Granularity Modules Layers Vertical slices Subsystems

  19. Granularity Java ARchive Package Class

  20. Divide and conquer

  21. Component Single unit to understand

  22. Component Single unit to change

  23. Component Scope of risk of change

  24. B Smaller unit to understand A

  25. B Reduced risk of change A

  26. B Cost of separation A

  27. B Definition and maintenance of dependencies A

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

  29. How do I add a feature?

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

    Wolff
  31. Of layers and slices…

  32. Presentation Service Data Access Account Customer Core

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

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

  35. Presentation Service Data Access Account Customer Core

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

  37. Architecture VS. Codebase

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

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

  40. Code analysis JDepend Sonarcube

  41. Sonargraph Formerly known as SonarJ

  42. Demo

  43. A plain Java based approach

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

  45. Presentation Service Data Access Account Customer Core

  46. Packages

  47. ….layer.slice ….slice.layer ….slice

  48. ….web.core ….service.core ….repository.core

  49. ….core.web ….core.service ….core.repository

  50. ….core ….customer ….account

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

  52. "Does it make a difference?

  53. Dependency management

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

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

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

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

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

  59. Presentation Service Data Access Account Customer Core

  60. Presentation Service Data Access Account Customer Core

  61. Demo

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

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

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

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

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

    Tilkov - Talk @ InfoQ Eberhard Wolff - Slides @ Slideshare