My tech talk, fairy tale sources: 1, 2, 3, 4.
Java, Groovy + Spock, Kotlin, Maven, Spring
The main focus should be on The Three Little Pigs, but to show an alternative, more pragmatic approach there is also Little Red Riding Hood module, utilizing package-private access more, close to what's presented in this great tech talk by Jakub Nabrdalik.
App starts as an ordinary web app for
spring.main.web-application-type=servletAvailable operations:
- Build house:
POSTlocalhost:8080/housesPossible values for{ "owner": "VERY_LAZY" }owner:VERY_LAZYLAZYNOT_LAZYNOT_LAZY_ANYMORE
- Verify the house state:
GETlocalhost:8080/houses/{id} - Blow house down:
DELETElocalhost:8080/houses/{id}
There is a dedicated Postman collection with all these operations already
defined: pigs3/adapters/src/main/resources/3Pigs.postman_collection.json.
There is a dedicated Postman collection with all the operations ready to
use: redhood/src/main/resources/RedHood.postman_collection.json.
When
spring.main.web-application-type=noneapp prints the whole The Three Little Pigs story in the console.
An example session with myself, for The Three Little Pigs. There was no need to run Process Level ES as we already had a single BoundedContext, and it was doable to jump straight into Design Level.
For the second module I also run Big Picture ES which helped to realize that the main things are interactions and wolf's intentions.
Housecould have mechanisms for rebuilding- Story can be extended - currently there is nothing about wolf climbing through the chimney and pigs lighting the fire
- New
Housemethod, e.g.litFire - New
BigBadWolfServicemethod, e.g.comeDownTheChimneyOf - Event, e.g.
WolfStartedClimbinginstead ofWolfResignedFromAttacking, new event fromHouse, e.g.WolfEscaped(when burns in the fireplace) WolfStartedClimbingshould call bothlitFireandcomeDownTheChimneyOfin a proper orderWolfEscapedshould result in knowledge sharing
- New
- Full Event Sourcing -
Housecan be built just from events, no snapshots in the current form - Rely fully on
DomainEventPublisher- although@DomainEventsannotation looks nice, it relies onApplicationEventPublisherwhich has known limitations, especially without additional tooling like Spring Modulith - Instead of "technical" packages corresponding with Clean Architecture and DDD, there could be more process-oriented
packages, like
building(orconstrucitng) anddestroying, where the domain logic would lay, similar as presented in this great tech talk by Victor Rentea


