$30 off During Our Annual Pro Sale. View Details »

Spring for the Architecturally Curious Developer

Spring for the Architecturally Curious Developer

Oliver Drotbohm

November 09, 2022
Tweet

More Decks by Oliver Drotbohm

Other Decks in Programming

Transcript

  1. SPRING FOR ARCHITECTURALLY CURIOUS DEVELOPERS Oliver Drotbohm odrotbohm@vmware.com / odrotbohm

  2. None
  3. Coming in 2023… Follow @mawspring on

  4. The Domain

  5. Orders Inventory Order Line items Stock Inventory items

  6. Unfortunately, Post-its don't run in production…

  7. Unfortunately, Post-its don't run in production… … except you work

    at Miro.
  8. None
  9. None
  10. Awesome! ! Now… what? "

  11. Let's get started… src/main/java ….acme.myproject ….acme.myproject.domain ….acme.myproject.persistence ….acme.myproject.service ….acme.myproject.web

  12. None
  13. Let's get started… src/main/java ….acme.myproject ….acme.myproject.domain ….acme.myproject.persistence ….acme.myproject.service ….acme.myproject.web #$

  14. via https://devopedia.org/cohesion-vs-coupling

  15. Domain Based Structure Domain Based Boundaries via Dan North –

    CUPID—for joyful coding Video cast episode @ Software Architektur im Stream (english)
  16. src/main/java ….acme.myproject ….acme.myproject.customer ….acme.myproject.inventory ….acme.myproject.order Much better… %!

  17. via https://devopedia.org/cohesion-vs-coupling

  18. Web Business logic Data access @Repository Order Inventory … @Controller

    @Service Verification? Testing? Documentation? Observation?
  19. None
  20. Sample code https://github.com/odrotbohm/arch-evident-spring

  21. Demo time! &!

  22. Error Scenarios Transactional Event Listeners

  23. @EventListener @EventListener … @TransactionalEventListener @TransactionalEventListener … @Transactional Event Event Commit

    Consistency boundary Spring bean Legend
  24. Error scenarios

  25. What if a transactional event listener fails? "

  26. @EventListener @EventListener … @TransactionalEventListener @TransactionalEventListener … @Transactional Event Event Commit

    Consistency boundary Spring bean Legend Publication lost! ) '(
  27. Event Publication Registry

  28. @TransactionalEventListener @TransactionalEventListener … Event @TransactionalEventListener … @TransactionalEventListener … Transaction Commit

  29. Demo time! &!

  30. Spring Modulith A convention to map modules to packages Simple

    set of access rules and API to verify Test support to bootstrap modules Documentation support Observability support
  31. Thank you! Questions? Oliver Drotbohm odrotbohm@vmware.com odrotbohm Sample Code