Maintain Social Distance this Spring
summary
Argues that opinionated Java frameworks inject costly magic — runtime reflection, classpath scanning, proxies and auto‑configuration — and shows real failures: @Transactional on private method fails and self‑invocation bypasses proxies, H2 auto‑configured into production, Hibernate sequence deadlock and vanished metrics. Demonstrates practical mitigations: use TransactionTemplate instead, separate persistence/domain models, constructor wiring, jdbi/JdbcTemplate or Spring Data JDBC, hexagonal architecture, dev in‑memory profiles, and an Axon+Kafka routing workaround that replaces framework ownership with simple mapping. Shows code patterns and migration tactics.
AI-written summary · about
chapters (19)
- 0:00Introduction and motivation
- 1:10Frameworks and their promises
- 3:21Frameworks vs libraries
- 6:33Leaky abstractions in frameworks
- 13:54Problems with leaky abstractions
- 16:01Transactional annotation issues
- 18:50Simpler alternatives to annotations
- 20:40Overusing dependencies in Spring
- 22:30Zero dependencies approach
- 23:54ORM and domain persistence issues
- 28:51Separating domain and persistence models
- 31:20Reducing Spring's invasiveness
- 34:51Testing without Spring context
- 36:39Long-term software maintenance
- 38:02Coupling and cohesion in code
- 40:47Hexagonal and clean architecture
- 44:34Real-world framework adaptation
- 48:28Lightweight alternatives like Ratpack
- 49:53Context matters in tool selection
related talks
49mPerformance oriented Spring Data JPA & Hibernate
44mPerformance oriented Spring Data JPA & Hibernate
46mThe State of Java Relational Persistence
44mORM Insights - How not to hurt yourself?
51mEmpowering Enterprise Architectures with Polyglot Persistence
33mEffective Transactions Management with Spring
47mThere is always a choice. Spring Data JDBC vs. Hibernate. Taras Boychuk. Java Fest 2020 Online
42mEffective transaction management with Spring
