Spring Boot 3.3+ (Java 21) Skill
Purpose
Standardize backend service architecture, Spring Data JPA usage, layer boundaries, and Java 21 features.
1. Rules of Engagement
MANDATORY
- Use Java 21 features (Records, Pattern Matching, Sealed Classes).
- Use Spring Data
Pageable(org.springframework.data.domain.Pageable) internally in Repository and Service interfaces. - Separate DB Entity classes from external REST DTO records.
CONDITIONAL
- Virtual Threads: Enable Virtual Threads (
spring.threads.virtual.enabled=trueinapplication.yml) when high concurrency I/O blocking demands justify it and no thread-local/pinning issues exist.
MUST NOT
- Expose JPA
@Entityclasses directly in REST API Controller methods. - Use raw
Thread.sleep()or un-managed executor pools.