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

Schmutzige Hände mit Clean Architecture (JAX 2019)

Schmutzige Hände mit Clean Architecture (JAX 2019)

Was steckt eigentlich hinter den Begriffen "Clean Architecture" oder "Hexagonal Architecture"? Clean ist immer gut, oder? Sollte ich die mir so ans Herz gewachsene Layerarchitektur vergessen und nur noch Clean Architecture anwenden?

Diese Session gibt einen Überblick über die Konzepte und Ziele hinter Uncle Bob’s Clean Architecure und Co. und stellt Möglichkeiten vor, diese in (Java-)Code umzusetzen. Wir werden diskutieren, wann sich eine Clean Architecture lohnt, welche Abkürzungen man einbauen kann, um den Aufwand im Rahmen zu halten, und wann man lieber die Finger davonlassen sollte.

Tom Hombergs

May 09, 2019
Tweet

More Decks by Tom Hombergs

Other Decks in Technology

Transcript

  1. SOLID Principles S O L I D Single Responsibility Principle

    Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle
  2. Dependency Inversion Principle SOLID Principles S O L I D

    Single Responsibility Principle Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle
  3. Dependency Inversion Principle We can choose the direction of any

    code dependency* * As long as we have control over the code
  4. Single Responsibility Principle Dependency Inversion Principle SOLID Principles S O

    L I D Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle
  5. Single Responsibility Principle A module* should have only one reason

    to change * Read: class, package, component, architecture element, software entity, …
  6. Enforcing the Architecture - ArchUnit @Test void validateRegistrationContextArchitecture() { HexagonalArchitecture

    .boundedContext("io.reflectoring.copyeditor.registration") .withDomain("domain") .withAdapters("adapter") .incoming("in.web") .outgoing("out.persistence") .and() .withApplicationLayer("application") .services("book") .services("invitation") .incomingPorts("port.in") .outgoingPorts("port.out") .and() .withConfiguration("configuration") .check(allClasses()); }
  7. Enforcing the Architecture - Java Module System Yes, it will

    probably work … … but I'm used to having 5 years of time to learn each new Java version.