Java with a Clojure Mindset
summary
A Java bonus-processing service is reworked with Clojure ideas: domain objects become immutable, business logic is pure functions that return new state plus a list of effects, per-client state is managed with atoms via ConcurrentHashMap.compute, and Kafka supplies event-sourced input so the app rebuilds state from two months of messages. Side effects run from explicit effect objects, payment uses a relational DB for at-most-once guarantees, tests drop mocks and the core is far smaller and simpler.
AI-written summary · about
