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

Get Your Hands Dirty on Clean Architecture (Java Talks 12/2019)

Bc7aa56e8e004e4984e954e5e4cb2bc0?s=47 Tom Hombergs
December 05, 2019

Get Your Hands Dirty on Clean Architecture (Java Talks 12/2019)

An introduction to Robert C. Martin's Clean Architecture and Alistair Cockburn's Hexagonal Architecture with a link to an opinionated hexagonal coding style.

Bc7aa56e8e004e4984e954e5e4cb2bc0?s=128

Tom Hombergs

December 05, 2019
Tweet

More Decks by Tom Hombergs

Other Decks in Programming

Transcript

  1. @TomHombergs https://reflectoring.io Get Your Hands Dirty on Clean Architecture

  2. None
  3. @TomHombergs https://reflectoring.io Layers

  4. @TomHombergs https://reflectoring.io Why bother with architecture?

  5. @TomHombergs https://reflectoring.io Architecture Goals

  6. @TomHombergs https://reflectoring.io Architecture Goals

  7. @TomHombergs https://reflectoring.io The Ultimate Goal of Architecture The goal of

    software architecture is to minimize the lifetime cost of the software
  8. @TomHombergs https://reflectoring.io So ... what‘s wrong with layers?

  9. @TomHombergs https://reflectoring.io Disclaimer Layers are a solid 
 architecture pattern!

    But without additional restrictions they tend to erode
  10. @TomHombergs https://reflectoring.io Layers Promote Database-Driven Design

  11. @TomHombergs https://reflectoring.io Layers Promote Hard-to-test Shortcuts

  12. @TomHombergs https://reflectoring.io Layers Promote Hidden Functionality

  13. @TomHombergs https://reflectoring.io Do circles instead!

  14. @TomHombergs https://reflectoring.io SOLID Principles S O L I D Single

    Responsibility Principle Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle
  15. @TomHombergs https://reflectoring.io Dependency Inversion Principle SOLID Principles S O L

    I D Single Responsibility Principle Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle
  16. @TomHombergs https://reflectoring.io Dependency Inversion Principle

  17. @TomHombergs https://reflectoring.io Dependency Inversion Principle We can choose the direction

    of any code dependency* * As long as we have control over the code
  18. @TomHombergs https://reflectoring.io Clean Architecture (Robert C. Martin)

  19. @TomHombergs https://reflectoring.io Single Responsibility Principle Dependency Inversion Principle SOLID Principles

    S O L I D Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle
  20. @TomHombergs https://reflectoring.io Single Responsibility Principle

  21. @TomHombergs https://reflectoring.io Single Responsibility Principle A module* should have only

    one reason to change * or class, package, component, architecture element, software entity, …
  22. @TomHombergs https://reflectoring.io Single Responsibility Principle – Micro Level

  23. @TomHombergs https://reflectoring.io Single Responsibility Principle – Micro Level

  24. @TomHombergs https://reflectoring.io Single Responsibility Principle – Macro Level

  25. @TomHombergs https://reflectoring.io Single Responsibility Principle – Macro Level

  26. @TomHombergs https://reflectoring.io Domain-Driven Design Only a domain-centric architecture allows Domain-Driven

    Design
  27. @TomHombergs https://reflectoring.io Or do hexagons instead!

  28. @TomHombergs https://reflectoring.io Hexagonal Architecture / Ports & Adapters (Alistair Cockburn)

  29. @TomHombergs https://reflectoring.io Choose your Polygonal Style

  30. @TomHombergs https://reflectoring.io Quiz: What does this Application do?

  31. @TomHombergs https://reflectoring.io Quiz: What does this Application do?

  32. @TomHombergs https://reflectoring.io Let‘s get our hands dirty! Code Example: https://github.com/thombergs/buckpal

  33. @TomHombergs https://reflectoring.io Conclusion

  34. @TomHombergs https://reflectoring.io Benefits of a Domain-Centric Architecture

  35. @TomHombergs https://reflectoring.io Drawbacks of a Domain-Centric Architecture

  36. @TomHombergs https://reflectoring.io Thank you for your Patience …if you promise

    to post a review on Amazon :) https://speakerdeck.com/thombergs/2019 Slides! https://reflectoring.io/javatalks Free ebook! Pretty Book Covers!