Slide 1

Slide 1 text

SPRING FOR ARCHITECTURALLY CURIOUS DEVELOPERS Oliver Drotbohm [email protected] / odrotbohm

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Coming in 2023… Follow @mawspring on

Slide 4

Slide 4 text

The Domain

Slide 5

Slide 5 text

Orders Inventory Order Line items Stock Inventory items

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Awesome! ! Now… what? "

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

Domain Based Structure Domain Based Boundaries via Dan North – CUPID—for joyful coding Video cast episode @ Software Architektur im Stream (english)

Slide 16

Slide 16 text

src/main/java ….acme.myproject ….acme.myproject.customer ….acme.myproject.inventory ….acme.myproject.order Much better… %!

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

Web Business logic Data access @Repository Order Inventory … @Controller @Service Verification? Testing? Documentation? Observation?

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Sample code https://github.com/odrotbohm/arch-evident-spring

Slide 21

Slide 21 text

Demo time! &!

Slide 22

Slide 22 text

Error Scenarios Transactional Event Listeners

Slide 23

Slide 23 text

@EventListener @EventListener … @TransactionalEventListener @TransactionalEventListener … @Transactional Event Event Commit Consistency boundary Spring bean Legend

Slide 24

Slide 24 text

Error scenarios

Slide 25

Slide 25 text

What if a transactional event listener fails? "

Slide 26

Slide 26 text

@EventListener @EventListener … @TransactionalEventListener @TransactionalEventListener … @Transactional Event Event Commit Consistency boundary Spring bean Legend Publication lost! ) '(

Slide 27

Slide 27 text

Event Publication Registry

Slide 28

Slide 28 text

@TransactionalEventListener @TransactionalEventListener … Event @TransactionalEventListener … @TransactionalEventListener … Transaction Commit

Slide 29

Slide 29 text

Demo time! &!

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Thank you! Questions? Oliver Drotbohm [email protected] odrotbohm Sample Code