Template Method or composition: refactoring a booking flow from v0 to v2
Three versions of a homestay booking flow: one transactional method that does everything, steps with if-checks on the listing type, then Template Method with a hook. Three rules that keep Template Method safe, the traps inside Spring (constructor injection, @SneakyThrows, self-invocation), and when to switch to composition.